public class DictionariesManager extends java.lang.Object implements DirectoryMonitor.Callback
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,IDictionary> |
dictionaries |
static java.lang.String |
DICTIONARY_SUBDIR |
protected java.util.List<IDictionaryFactory> |
factories |
static java.lang.String |
IGNORE_FILE |
protected java.util.Set<java.lang.String> |
ignoreWords |
protected DirectoryMonitor |
monitor |
Constructor and Description |
---|
DictionariesManager(IDictionaries pane) |
Modifier and Type | Method and Description |
---|---|
void |
addDictionaryFactory(IDictionaryFactory dict) |
void |
addIgnoreWord(java.lang.String word)
Add new ignore word.
|
protected boolean |
doFuzzyMatching() |
void |
fileChanged(java.io.File file)
Executed on file changed.
|
java.util.List<DictionaryEntry> |
findWords(java.util.Collection<java.lang.String> words)
Find words list in all dictionaries.
|
protected void |
loadIgnoreWords(java.io.File file)
Load ignored words from 'ignore.txt' file.
|
void |
removeDictionaryFactory(IDictionaryFactory factory) |
void |
setIndexLanguage(Language indexLanguage) |
void |
setTokenizer(ITokenizer tokenizer) |
void |
start(java.io.File dictDir) |
void |
stop() |
public static final java.lang.String IGNORE_FILE
public static final java.lang.String DICTIONARY_SUBDIR
protected DirectoryMonitor monitor
protected final java.util.List<IDictionaryFactory> factories
protected final java.util.Map<java.lang.String,IDictionary> dictionaries
protected final java.util.Set<java.lang.String> ignoreWords
public DictionariesManager(IDictionaries pane)
public void addDictionaryFactory(IDictionaryFactory dict)
public void removeDictionaryFactory(IDictionaryFactory factory)
public void start(java.io.File dictDir)
public void stop()
public void fileChanged(java.io.File file)
fileChanged
in interface DirectoryMonitor.Callback
protected void loadIgnoreWords(java.io.File file) throws java.io.IOException
java.io.IOException
public void addIgnoreWord(java.lang.String word)
public java.util.List<DictionaryEntry> findWords(java.util.Collection<java.lang.String> words)
words
- words listpublic void setIndexLanguage(Language indexLanguage)
public void setTokenizer(ITokenizer tokenizer)
protected boolean doFuzzyMatching()