Package org.omegat.core.dictionaries
Interface IDictionaryFactory
public interface IDictionaryFactory
An interface that defines support for a particular dictionary format.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisSupportedFile(File file) Determine whether or not the supplied file is supported by this factory.Load the given file and return anIDictionarythat wraps it.default IDictionaryLoad the given file and return anIDictionarythat wraps it.
-
Method Details
-
isSupportedFile
Determine whether or not the supplied file is supported by this factory. This is intended to be a lightweight check, e.g. looking for a file extension.- Parameters:
file- The file to check- Returns:
- Whether or not the file is supported
-
loadDict
Load the given file and return anIDictionarythat wraps it. Deprecated; useloadDict(File, Language)instead.- Parameters:
file- The file to load- Returns:
- An IDictionary file that can read articles from the file
- Throws:
Exception- If the file could not be loaded for reasons that were not determined byisSupportedFile(File)
-
loadDict
Load the given file and return anIDictionarythat wraps it. The supplied file is guaranteed to have returned true fromisSupportedFile(File).- Parameters:
file- The file to loadlanguage- The language of the dictionary's index (e.g. English for an English-French dictionary)- Returns:
- An IDictionary file that can read articles from the file
- Throws:
Exception- If the file could not be loaded for reasons that were not determined byisSupportedFile(File)
-