Package org.omegat.core.dictionaries
Interface IDictionaryFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
isSupportedFile(java.io.File file)
Determine whether or not the supplied file is supported by this factory.IDictionary
loadDict(java.io.File file)
Load the given file and return anIDictionary
that wraps it.default IDictionary
loadDict(java.io.File file, Language language)
Load the given file and return anIDictionary
that wraps it.
-
-
-
Method Detail
-
isSupportedFile
boolean isSupportedFile(java.io.File file)
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
IDictionary loadDict(java.io.File file) throws java.lang.Exception
Load the given file and return anIDictionary
that 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:
java.lang.Exception
- If the file could not be loaded for reasons that were not determined byisSupportedFile(File)
-
loadDict
default IDictionary loadDict(java.io.File file, Language language) throws java.lang.Exception
Load the given file and return anIDictionary
that 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:
java.lang.Exception
- If the file could not be loaded for reasons that were not determined byisSupportedFile(File)
-
-