Class SynonymMap.Parser
- java.lang.Object
-
- org.apache.lucene.analysis.synonym.SynonymMap.Builder
-
- org.apache.lucene.analysis.synonym.SynonymMap.Parser
-
- Direct Known Subclasses:
SolrSynonymParser
,WordnetSynonymParser
- Enclosing class:
- SynonymMap
public abstract static class SynonymMap.Parser extends SynonymMap.Builder
Abstraction for parsing synonym files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CharsRef
analyze(java.lang.String text, CharsRef reuse)
Sugar: analyzes the text with the analyzer and separates bySynonymMap.WORD_SEPARATOR
.abstract void
parse(java.io.Reader in)
Parse the given input, adding synonyms to the inheritedSynonymMap.Builder
.-
Methods inherited from class org.apache.lucene.analysis.synonym.SynonymMap.Builder
add, build, join
-
-
-
-
Constructor Detail
-
Parser
public Parser(boolean dedup, Analyzer analyzer)
-
-
Method Detail
-
parse
public abstract void parse(java.io.Reader in) throws java.io.IOException, java.text.ParseException
Parse the given input, adding synonyms to the inheritedSynonymMap.Builder
.- Parameters:
in
- The input to parse- Throws:
java.io.IOException
java.text.ParseException
-
analyze
public CharsRef analyze(java.lang.String text, CharsRef reuse) throws java.io.IOException
Sugar: analyzes the text with the analyzer and separates bySynonymMap.WORD_SEPARATOR
. reuse and its chars must not be null.- Throws:
java.io.IOException
-
-