|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpitt.search.semanticvectors.CompoundVectorBuilder
public class CompoundVectorBuilder
This class contains methods for manipulating queries, e.g., taking a list of queryterms and producing a (possibly weighted) aggregate query vector. In the fullness of time this will hopefully include parsing and building queries that include basic (quantum) logical operations. So far these basic operations include negation of one or more terms.
Constructor Summary | |
---|---|
CompoundVectorBuilder(VectorStore vecReader)
Constructor that defaults LuceneUtils to null. |
|
CompoundVectorBuilder(VectorStore vecReader,
LuceneUtils lUtils)
|
Method Summary | |
---|---|
protected float[] |
getAdditiveQueryVector(java.lang.String[] queryTerms)
Returns a (possibly weighted) normalized query vector created by adding together vectors retrieved from vector store. |
protected float[] |
getAdditiveQueryVectorRegex(java.lang.String[] queryTerms)
Returns a (possibly weighted) normalized query vector created by adding together all vectors retrieved from vector store whose objects match a particular regular expression. |
protected float[] |
getNegatedQueryVector(java.lang.String[] queryTerms,
int split)
Creates a vector including orthogonalizing negated terms. |
static float[] |
getPermutedQueryVector(VectorStore vecReader,
LuceneUtils lUtils,
java.lang.String[] queryTerms)
Returns a vector representation containing both content and positional information |
static float[] |
getQueryVector(VectorStore vecReader,
LuceneUtils lUtils,
java.lang.String[] queryTerms)
Method gets a query vector from an array of query terms. |
static float[] |
getQueryVectorFromString(VectorStore vecReader,
LuceneUtils lUtils,
java.lang.String queryString)
Method gets a query vector from a query string, i.e., a space-separated list of queryterms. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompoundVectorBuilder(VectorStore vecReader, LuceneUtils lUtils)
public CompoundVectorBuilder(VectorStore vecReader)
Method Detail |
---|
public static float[] getPermutedQueryVector(VectorStore vecReader, LuceneUtils lUtils, java.lang.String[] queryTerms) throws java.lang.IllegalArgumentException
queryTerms
- String array of query terms to look up. Expects a single "?" entry, which
denotes the query term position. E.g., "martin ? king" might pick out "luther".
java.lang.IllegalArgumentException
public static float[] getQueryVectorFromString(VectorStore vecReader, LuceneUtils lUtils, java.lang.String queryString)
public static float[] getQueryVector(VectorStore vecReader, LuceneUtils lUtils, java.lang.String[] queryTerms)
vecReader
- The vector store reader to use.lUtils
- Lucene utilities for getting term weights.queryTerms
- Query expression, e.g., from command line. If
the term NOT appears in queryTerms, terms after that will
be negated.
protected float[] getAdditiveQueryVector(java.lang.String[] queryTerms)
queryTerms
- String array of query terms to look up.protected float[] getAdditiveQueryVectorRegex(java.lang.String[] queryTerms)
queryTerms
- String array of query terms to look up.protected float[] getNegatedQueryVector(java.lang.String[] queryTerms, int split)
queryTerms
- List of positive and negative terms.split
- Position in this list of the NOT mark: terms
before this are positive, those after this are negative.
VectorUtils.orthogonalizeVectors(java.util.ArrayList)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |