@BeforeClass public static void loadDictionary() throws Exception { dictionaryLemmatizer = new DictionaryLemmatizer( DictionaryLemmatizerTest.class.getResourceAsStream("/opennlp/tools/lemmatizer/smalldictionary.dict") ); }
@BeforeClass public static void loadDictionary() throws Exception { dictionaryLemmatizer = new DictionaryLemmatizer( DictionaryLemmatizerTest.class.getResourceAsStream( "/opennlp/tools/lemmatizer/smalldictionarymulti.dict") ); }
/** * Creates a new lemmatizer that uses a dictionary. * @param dictionary The full path to the dictionary file. * @throws IOException Thrown if the dictionary cannot be opened. */ public DefaultLemmatizer(String dictionary) throws IOException { isModelBased = false; InputStream dictLemmatizer = new FileInputStream(dictionary); lemmatizer = new DictionaryLemmatizer(dictLemmatizer); dictLemmatizer.close(); }