org.apache.mahout.utils.vectors.lucene
Class LuceneIterable
java.lang.Object
org.apache.mahout.utils.vectors.lucene.LuceneIterable
- All Implemented Interfaces:
- Iterable<Vector>
public class LuceneIterable
- extends Object
- implements Iterable<Vector>
A LuceneIterable is an Iterable<Vector> that uses a Lucene index as the source for creating the
Vector
. The Field used to create the Vector currently must have Term Vectors stored for it.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_NORMALIZING
public static final double NO_NORMALIZING
- See Also:
- Constant Field Values
LuceneIterable
public LuceneIterable(org.apache.lucene.index.IndexReader reader,
String idField,
String field,
VectorMapper mapper)
LuceneIterable
public LuceneIterable(org.apache.lucene.index.IndexReader reader,
String idField,
String field,
VectorMapper mapper,
double normPower)
- Produce a LuceneIterable that can create the Vector plus normalize it.
- Parameters:
reader
- The IndexReader
to read the documents from.idField
- - The Field containing the id. May be nullfield
- The field to use for the Vectormapper
- The VectorMapper
for creating
Vector
s from Lucene's TermVectors.normPower
- The normalization value. Must be greater than or equal to 0 or equal to NO_NORMALIZING
iterator
public Iterator<Vector> iterator()
- Specified by:
iterator
in interface Iterable<Vector>
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.