|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.analysis.synonym.SynonymMap.Builder
public static class SynonymMap.Builder
Builds an FSTSynonymMap.
Call add() until you have added all the mappings, then call build() to get an FSTSynonymMap
Constructor Summary | |
---|---|
SynonymMap.Builder(boolean dedup)
If dedup is true then identical rules (same input, same output) will be added only once. |
Method Summary | |
---|---|
void |
add(org.apache.lucene.util.CharsRef input,
org.apache.lucene.util.CharsRef output,
boolean includeOrig)
Add a phrase->phrase synonym mapping. |
static org.apache.lucene.util.CharsRef |
analyze(org.apache.lucene.analysis.Analyzer analyzer,
String text,
org.apache.lucene.util.CharsRef reuse)
Sugar: analyzes the text with the analyzer and separates by SynonymMap.WORD_SEPARATOR . |
SynonymMap |
build()
Builds an SynonymMap and returns it. |
static org.apache.lucene.util.CharsRef |
join(String[] words,
org.apache.lucene.util.CharsRef reuse)
Sugar: just joins the provided terms with SynonymMap.WORD_SEPARATOR . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynonymMap.Builder(boolean dedup)
Method Detail |
---|
public static org.apache.lucene.util.CharsRef join(String[] words, org.apache.lucene.util.CharsRef reuse)
SynonymMap.WORD_SEPARATOR
. reuse and its chars
must not be null.
public static org.apache.lucene.util.CharsRef analyze(org.apache.lucene.analysis.Analyzer analyzer, String text, org.apache.lucene.util.CharsRef reuse) throws IOException
SynonymMap.WORD_SEPARATOR
.
reuse and its chars must not be null.
IOException
public void add(org.apache.lucene.util.CharsRef input, org.apache.lucene.util.CharsRef output, boolean includeOrig)
input
- input phraseoutput
- output phraseincludeOrig
- true if the original should be includedpublic SynonymMap build() throws IOException
SynonymMap
and returns it.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |