C# Class org.apache.lucene.analysis.synonym.SynonymMap.Builder

Builds an FSTSynonymMap.

Call add() until you have added all the mappings, then call build() to get an FSTSynonymMap @lucene.experimental

ファイルを表示 Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
Builder ( bool dedup ) : System

If dedup is true then identical rules (same input, same output) will be added only once.

add ( CharsRef input, CharsRef output, bool includeOrig ) : void

Add a phrase->phrase synonym mapping. Phrases are character sequences where words are separated with character zero (U+0000). Empty words (two U+0000s in a row) are not allowed in the input nor the output!

build ( ) : SynonymMap

Builds an SynonymMap and returns it.

join ( string words, CharsRef reuse ) : CharsRef

Sugar: just joins the provided terms with {@link SynonymMap#WORD_SEPARATOR}. reuse and its chars must not be null.

Private Methods

Method Description
add ( CharsRef input, int numInputWords, CharsRef output, int numOutputWords, bool includeOrig ) : void
countWords ( CharsRef chars ) : int
hasHoles ( CharsRef chars ) : bool

only used for asserting!

Method Details

Builder() public method

If dedup is true then identical rules (same input, same output) will be added only once.
public Builder ( bool dedup ) : System
dedup bool
return System

add() public method

Add a phrase->phrase synonym mapping. Phrases are character sequences where words are separated with character zero (U+0000). Empty words (two U+0000s in a row) are not allowed in the input nor the output!
public add ( CharsRef input, CharsRef output, bool includeOrig ) : void
input CharsRef input phrase
output CharsRef output phrase
includeOrig bool true if the original should be included
return void

build() public method

Builds an SynonymMap and returns it.
public build ( ) : SynonymMap
return SynonymMap

join() public static method

Sugar: just joins the provided terms with {@link SynonymMap#WORD_SEPARATOR}. reuse and its chars must not be null.
public static join ( string words, CharsRef reuse ) : CharsRef
words string
reuse CharsRef
return CharsRef