以nltk一致的参数宽度

时间:2019-03-14 03:48:54

标签: python nltk

每个人。我现在正在学习nltk,并对Text.concordance感到困惑。宽度与显示物有什么关系? 我认为宽度是指您指定的单词周围的字符数,因此宽度越大,结果越长。但是,我明白了

>>> text3.concordance("beginning", width=10, lines=5)
Displaying 5 of 5 matches:
n the beginning Go
nd the beginning o
t the beginning 
t the beginning 
nd the beginning o

>>> text3.concordance("beginning", width=13, lines=5)
Displaying 5 of 5 matches:
e beginning G
e beginning o
e beginning ,
e beginning .
e beginning o

宽度从10增加到13,但是输出的长度变短了!

有人可以帮助我吗?非常感谢你!

0 个答案:

没有答案