def text2sentences(text):
'''Tokenize text into sentence tokens.'''
content = '\n'.join([open(f).read() for f in text])
sentences = []
try:
sentences = sent_tokenize(content)
except LookupError as err:
click.echo(message="Error with tokenization", nl=True)
click.echo(message="Have you run \"textkit download\"?", nl=True)
click.echo(message="\nOriginal Error:", nl=True)
click.echo(err)
[output(s.strip()) for s in sentences]
评论列表
文章目录