public static class SynonymMap.Builder
extends java.lang.Object
Call add() until you have added all the mappings, then call build() to get an FSTSynonymMap
| Constructor and Description |
|---|
Builder(boolean dedup)
If dedup is true then identical rules (same input,
same output) will be added only once.
|
| Modifier and Type | Method and Description |
|---|---|
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,
java.lang.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(java.lang.String[] words,
org.apache.lucene.util.CharsRef reuse)
Sugar: just joins the provided terms with
SynonymMap.WORD_SEPARATOR. |
public Builder(boolean dedup)
public static org.apache.lucene.util.CharsRef join(java.lang.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,
java.lang.String text,
org.apache.lucene.util.CharsRef reuse)
throws java.io.IOException
SynonymMap.WORD_SEPARATOR.
reuse and its chars must not be null.java.io.IOExceptionpublic 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 java.io.IOException
SynonymMap and returns it.java.io.IOExceptionCopyright © 2000-2022 Apache Software Foundation. All Rights Reserved.