Class HunspellDictionaryInstaller
java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellDictionaryInstaller
Opt-in installation of Hunspell
.aff/.dic pairs and their license
readme from an application-supplied DictionaryCatalog. Requires
DictionaryCatalog.REMOTE_DOWNLOAD_PROPERTY to be true. OpenNLP
bundles neither a catalog nor dictionary data.- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinstallFromCatalog(DictionaryCatalog catalog, String dictionaryId, Path targetDirectory) Installs the cataloged.aff,.dic, and readme files fordictionaryIdintotargetDirectory.
-
Method Details
-
installFromCatalog
public static void installFromCatalog(DictionaryCatalog catalog, String dictionaryId, Path targetDirectory) throws IOException Installs the cataloged.aff,.dic, and readme files fordictionaryIdintotargetDirectory. Each file uses its configured name or source name, for exampleen_US.aff. Existing target files are not replaced, so they must be removed before refreshing a dictionary.- Parameters:
catalog- The application-supplied catalog. Must not benull.dictionaryId- The catalog dictionary name, for exampleen_US. Must not benull.targetDirectory- The directory to write into; created when absent. Must not benull.- Throws:
IOException- Thrown if remote downloads are disabled, a catalog entry is missing, verification fails, or the target already contains one of the files.IllegalArgumentException- Thrown if a parameter isnull.
-