List of usage examples for org.apache.lucene.analysis.ja.dict UserDictionary open
public static UserDictionary open(Reader reader) throws IOException
From source file:org.elasticsearch.index.analysis.Kuromoji2TokenizerFactory.java
License:Apache License
public static UserDictionary getUserDictionary(Environment env, Settings settings) { try {//ww w . j ava2 s . co m final Reader reader = Analysis.getReaderFromFile(env, settings, USER_DICT_OPTION); if (reader == null) { return null; } else { try { return UserDictionary.open(reader); } finally { reader.close(); } } } catch (IOException e) { throw new ElasticsearchException("failed to load kuromoji user dictionary", e); } }