org.apache.solr.analysis
Class SynonymMap
java.lang.Object
org.apache.solr.analysis.SynonymMap
public class SynonymMap
- extends Object
Mapping rules for use with SynonymFilter
- Version:
- $Id: SynonymMap.java 614793 2008-01-24 04:41:38Z yonik $
SynonymMap
public SynonymMap()
SynonymMap
public SynonymMap(boolean ignoreCase)
includeOrig
public boolean includeOrig()
ignoreCase
public boolean ignoreCase()
add
public void add(List<String> singleMatch,
List<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 String toString()
- Overrides:
toString
in class Object
makeTokens
public static List<Token> makeTokens(List<String> strings)
- Produces a List from a List
mergeTokens
public static List<Token> mergeTokens(List<Token> lst1,
List<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)
Copyright © 2010 Apache Software Foundation. All Rights Reserved.