Class SolrSynonymParser
java.lang.Object
org.apache.lucene.analysis.synonym.SynonymMap.Builder
org.apache.lucene.analysis.synonym.SynonymMap.Parser
org.apache.lucene.analysis.synonym.SolrSynonymParser
Parser for the Solr synonyms format.
- Blank lines and lines starting with '#' are comments.
- Explicit mappings match any token sequence on the LHS of "=>"
and replace with all alternatives on the RHS. These types of mappings
ignore the expand parameter in the constructor.
Example:
i-pod, i pod => ipod
- Equivalent synonyms may be separated with commas and give
no explicit mapping. In this case the mapping behavior will
be taken from the expand parameter in the constructor. This allows
the same synonym file to be used in different synonym handling strategies.
Example:
ipod, i-pod, i pod
- Multiple synonym mapping entries are merged.
Example:
foo => foo bar
foo => baz
is equivalent to
foo => foo bar, baz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidParse the given input, adding synonyms to the inheritedSynonymMap.Builder.Methods inherited from class org.apache.lucene.analysis.synonym.SynonymMap.Parser
analyzeMethods inherited from class org.apache.lucene.analysis.synonym.SynonymMap.Builder
add, build, join
-
Constructor Details
-
SolrSynonymParser
-
-
Method Details
-
parse
Description copied from class:SynonymMap.ParserParse the given input, adding synonyms to the inheritedSynonymMap.Builder.- Specified by:
parsein classSynonymMap.Parser- Parameters:
in- The input to parse- Throws:
IOExceptionParseException
-