Class HunspellDictionaryDownload
java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellDictionaryDownload
Opt-in download of Hunspell
.aff/.dic pairs and their license
readme from an application-supplied DictionaryCatalog. Requires
-Dopennlp.download.remote=true. OpenNLP bundles neither a catalog nor
dictionary data.- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddownloadFromCatalog(DictionaryCatalog catalog, String dictionaryId, Path targetDirectory) Downloads the cataloged.aff,.dic, and readme files fordictionaryIdintotargetDirectory.
-
Method Details
-
downloadFromCatalog
public static void downloadFromCatalog(DictionaryCatalog catalog, String dictionaryId, Path targetDirectory) throws IOException Downloads 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.
-