本文整理了Java中org.apache.lucene.analysis.synonym.WordnetSynonymParser.parse()
方法的一些代码示例,展示了WordnetSynonymParser.parse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordnetSynonymParser.parse()
方法的具体详情如下:
包路径:org.apache.lucene.analysis.synonym.WordnetSynonymParser
类名称:WordnetSynonymParser
方法名:parse
暂无
代码示例来源:origin: lindstromhenrik/elasticsearch-analysis-file-watcher-synonym
@Override
public void run() {
try {
File synonymFile = new File(synonymFileURL.toURI());
if(synonymFile.exists() && lastModified < synonymFile.lastModified())
{
Reader rulesReader = new InputStreamReader(synonymFileURL.openStream(), Charsets.UTF_8);
SynonymMap.Builder parser = null;
if ("wordnet".equalsIgnoreCase(format)) {
parser = new WordnetSynonymParser(true, expand, analyzer);
((WordnetSynonymParser) parser).parse(rulesReader);
} else {
parser = new SolrSynonymParser(true, expand, analyzer);
((SolrSynonymParser) parser).parse(rulesReader);
}
synonymMap = parser.build();
lastModified = synonymFile.lastModified();
}
} catch (Exception e) {
throw new RuntimeException("could not reload synonyms file: " + e.getMessage());
}
}
}
代码示例来源:origin: bells/elasticsearch-analysis-dynamic-synonym
static SynonymMap.Builder getSynonymParser(Reader rulesReader, String format, boolean expand, Analyzer analyzer) throws IOException, ParseException {
SynonymMap.Builder parser;
if ("wordnet".equalsIgnoreCase(format)) {
parser = new WordnetSynonymParser(true, expand, analyzer);
((WordnetSynonymParser) parser).parse(rulesReader);
} else {
parser = new SolrSynonymParser(true, expand, analyzer);
((SolrSynonymParser) parser).parse(rulesReader);
}
return parser;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
((WordnetSynonymParser) parser).parse(rulesReader);
} else {
parser = new SolrSynonymParser(true, expand, analyzer);
代码示例来源:origin: lindstromhenrik/elasticsearch-analysis-file-watcher-synonym
((WordnetSynonymParser) parser).parse(rulesReader);
} else {
parser = new SolrSynonymParser(true, expand, analyzer);
内容来源于网络,如有侵权,请联系作者删除!