com.hankcs.hanlp.seg.common
类 Term

java.lang.Object
  继承者 com.hankcs.hanlp.seg.common.Term

public class Term
extends Object

一个单词,用户可以直接访问此单词的全部属性

作者:
hankcs

字段摘要
 Nature nature
          词性
 int offset
          在文本中的起始位置(需开启分词器的offset选项)
 String word
          词语
 
构造方法摘要
Term(String word, Nature nature)
          构造一个单词
 
方法摘要
 int getFrequency()
          获取本词语在HanLP词库中的频次
 int length()
          长度
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

word

public String word
词语


nature

public Nature nature
词性


offset

public int offset
在文本中的起始位置(需开启分词器的offset选项)

构造方法详细信息

Term

public Term(String word,
            Nature nature)
构造一个单词

参数:
word - 词语
nature - 词性
方法详细信息

toString

public String toString()
覆盖:
Object 中的 toString

length

public int length()
长度

返回:

getFrequency

public int getFrequency()
获取本词语在HanLP词库中的频次

返回:
频次,0代表这是个OOV


Copyright © 2014–2015 鐮佸啘鍦�/a>. All rights reserved.