public class Sentence extends Object implements Serializable, Iterable<IWord>
Modifier and Type | Method and Description |
---|---|
boolean |
containsWordWithLabel(String label)
是否含有词性为label的单词
|
static Sentence |
create(String param)
以人民日报2014语料格式的字符串创建一个结构化句子
|
boolean |
equals(Object o) |
IWord |
findFirstWordByLabel(String label)
找出第一个词性为label的单词(不检查复合词内部的简单词)
|
ListIterator<IWord> |
findFirstWordIteratorByLabel(String label)
找出第一个词性为label的单词的指针(不检查复合词内部的简单词)
若要查看该单词,请调用 previous 若要删除该单词,请调用 remove |
List<IWord> |
findWordsByLabel(String label)
找出所有词性为label的单词(不检查复合词内部的简单词)
|
int |
hashCode() |
Iterator<IWord> |
iterator() |
int |
length()
句子文本长度
|
Sentence |
mergeCompoundWords() |
int |
size()
句子中单词(复合词或简单词)的数量
|
String |
text()
原始文本形式(无标注,raw text)
|
String |
text(String delimiter)
原始文本形式(无标注,raw text)
|
List<Word> |
toSimpleWordList()
转换为简单单词列表
|
String |
toStandoff()
brat standoff format
http://brat.nlplab.org/standoff.html |
String |
toStandoff(boolean withComment)
brat standoff format
http://brat.nlplab.org/standoff.html |
String |
toString() |
String |
toStringWithoutLabels()
转换为空格分割无标签的String
|
String[] |
toWordArray()
获取所有单词构成的数组
|
String[][] |
toWordTagArray()
word pos
|
String[][] |
toWordTagNerArray(NERTagSet tagSet)
word pos ner
|
Sentence |
translateCompoundWordLabels()
按照 PartOfSpeechTagDictionary 指定的映射表将复合词词语词性翻译过去
|
Sentence |
translateLabels()
按照 PartOfSpeechTagDictionary 指定的映射表将词语词性翻译过去
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public String toStringWithoutLabels()
public String toStandoff()
public String toStandoff(boolean withComment)
withComment
- public Sentence translateLabels()
public Sentence translateCompoundWordLabels()
public static Sentence create(String param)
param
- public int size()
public int length()
public String text()
public String text(String delimiter)
delimiter
- 词语之间的分隔符public List<IWord> findWordsByLabel(String label)
label
- public IWord findFirstWordByLabel(String label)
label
- public ListIterator<IWord> findFirstWordIteratorByLabel(String label)
label
- public boolean containsWordWithLabel(String label)
label
- public String[] toWordArray()
public String[][] toWordTagArray()
public String[][] toWordTagNerArray(NERTagSet tagSet)
tagSet
- public Sentence mergeCompoundWords()
Copyright © 2014–2019 码农场. All rights reserved.