public class WordDictionaryBuilder
extends com.exalead.gni.GNIObject
Constructor and Description |
---|
WordDictionaryBuilder()
Initialize a new WordDictionaryBuilder whose words have no display forms associated
|
WordDictionaryBuilder(boolean prefix,
boolean withDisplayForms)
Initialize a new WordDictionaryBuilder
|
Modifier and Type | Method and Description |
---|---|
boolean |
addWord(java.lang.String word)
Add a word to the dictionary set
|
boolean |
addWord(java.lang.String word,
long freq,
int langCode)
Add a word to the dictionary set
|
boolean |
addWord(java.lang.String word,
long freq,
int langCode,
java.lang.String displayForm)
Add a word to the dictionary set
|
boolean |
addWordWithMultipleDisplayForms(java.lang.String word,
FreqDForm[] displayForms)
Add a word associated to several output display form
|
boolean |
addWordWithMultipleDisplayForms(java.lang.String word,
FreqDForm[] displayForms,
int langCode)
Add a word associated to several output display form
|
boolean |
compile(java.lang.String filename)
Compile the constructed dictionary
|
protected void |
finalize() |
public WordDictionaryBuilder(boolean prefix, boolean withDisplayForms)
prefix
- withDisplayForms
- if true, one or several output display forms will be associated to each wordpublic WordDictionaryBuilder()
public boolean addWord(java.lang.String word, long freq, int langCode, java.lang.String displayForm)
word
- the word to be addedfreq
- frequency associated to wordlangCode
- language codedisplayForm
- output display form when matchedpublic boolean addWord(java.lang.String word, long freq, int langCode)
word
- the word to be addedfreq
- frequency associated to wordlangCode
- language codepublic boolean addWord(java.lang.String word)
word
- the word to be addedpublic boolean addWordWithMultipleDisplayForms(java.lang.String word, FreqDForm[] displayForms)
word
- the word to be addeddisplayForms
- an array of display forms used for output annotationspublic boolean addWordWithMultipleDisplayForms(java.lang.String word, FreqDForm[] displayForms, int langCode)
word
- the word to be addeddisplayForms
- an array of display forms used for output annotationslangCode
- language codepublic boolean compile(java.lang.String filename)
filename
- path to the binary output fileprotected void finalize()
finalize
in class java.lang.Object
Copyright © 2013 Dassault Systèmes, All Rights Reserved.