本文整理汇总了Java中com.hankcs.hanlp.tokenizer.NLPTokenizer类的典型用法代码示例。如果您正苦于以下问题:Java NLPTokenizer类的具体用法?Java NLPTokenizer怎么用?Java NLPTokenizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NLPTokenizer类属于com.hankcs.hanlp.tokenizer包,在下文中一共展示了NLPTokenizer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNLP
import com.hankcs.hanlp.tokenizer.NLPTokenizer; //导入依赖的package包/类
public static HanLPTokenizerFactory createNLP(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
return new HanLPTokenizerFactory(indexSettings, environment, name, settings) {
@Override
public Tokenizer create() {
return new HanLPTokenizer(NLPTokenizer.SEGMENT, null, enablePorterStemming);
}
};
}
示例2: main
import com.hankcs.hanlp.tokenizer.NLPTokenizer; //导入依赖的package包/类
public static void main(String[] args)
{
HanLP.Config.enableDebug();
List<Term> termList = NLPTokenizer.segment("上外日本文化经济学院的陆晚霞教授正在教授泛读课程");
System.out.println(termList);
}
示例3: compute
import com.hankcs.hanlp.tokenizer.NLPTokenizer; //导入依赖的package包/类
public static CoNLLSentence compute(String text)
{
return compute(NLPTokenizer.segment(text));
}
示例4: NLPSegment
import com.hankcs.hanlp.tokenizer.NLPTokenizer; //导入依赖的package包/类
/**
* NLP分词
* 执行全部命名实体识别和词性标注
* @param content 文本
* @param filterStopWord 滤掉停用词
* @return
*/
public static List<Term> NLPSegment(String content, boolean filterStopWord) {
List<Term> result = NLPTokenizer.segment(content);
if (filterStopWord)
CoreStopWordDictionary.apply(result);
return result;
}