org.apache.lucene.analysis.synonym
Class SynonymMap
java.lang.Object
org.apache.lucene.analysis.synonym.SynonymMap
public class SynonymMap
- extends java.lang.Object
Mapping rules for use with SynonymFilter
Method Summary |
void |
add(java.util.List<java.lang.String> singleMatch,
java.util.List<org.apache.lucene.analysis.Token> replacement,
boolean includeOrig,
boolean mergeExisting)
|
boolean |
ignoreCase()
|
boolean |
includeOrig()
|
static java.util.List<org.apache.lucene.analysis.Token> |
makeTokens(java.util.List<java.lang.String> strings)
Produces a List from a List |
static java.util.List<org.apache.lucene.analysis.Token> |
mergeTokens(java.util.List<org.apache.lucene.analysis.Token> lst1,
java.util.List<org.apache.lucene.analysis.Token> lst2)
Merge two lists of tokens, producing a single list with manipulated positionIncrements so that
the tokens end up at the same position. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
submap
public org.apache.lucene.analysis.CharArrayMap<SynonymMap> submap
synonyms
public org.apache.lucene.analysis.Token[] synonyms
SynonymMap
public SynonymMap()
SynonymMap
public SynonymMap(boolean ignoreCase)
includeOrig
public boolean includeOrig()
ignoreCase
public boolean ignoreCase()
add
public void add(java.util.List<java.lang.String> singleMatch,
java.util.List<org.apache.lucene.analysis.Token> replacement,
boolean includeOrig,
boolean mergeExisting)
- Parameters:
singleMatch
- List, the sequence of strings to matchreplacement
- List the list of tokens to use on a matchincludeOrig
- sets a flag on this mapping signaling the generation of matched tokens in addition to the replacement tokensmergeExisting
- merge the replacement tokens with any other mappings that exist
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
makeTokens
public static java.util.List<org.apache.lucene.analysis.Token> makeTokens(java.util.List<java.lang.String> strings)
- Produces a List from a List
mergeTokens
public static java.util.List<org.apache.lucene.analysis.Token> mergeTokens(java.util.List<org.apache.lucene.analysis.Token> lst1,
java.util.List<org.apache.lucene.analysis.Token> lst2)
- Merge two lists of tokens, producing a single list with manipulated positionIncrements so that
the tokens end up at the same position.
Example: [a b] merged with [c d] produces [a/b c/d] ('/' denotes tokens in the same position)
Example: [a,5 b,2] merged with [c d,4 e,4] produces [c a,5/d b,2 e,2] (a,n means a has posInc=n)