fix iteration error (#208)
* fix iteration error array iteration error: sentences up till max_len of token exceeds should be returned * split list once instead of twice split list once instead of twice and take parsed string up till max token length is exceeded
This commit is contained in:
parent
feb53449e0
commit
3dde564948
1 changed files with 1 additions and 1 deletions
|
|
@ -154,7 +154,7 @@
|
|||
" for i, sentence in enumerate(sentences):\n",
|
||||
" ntokens += 1 + count_tokens(sentence)\n",
|
||||
" if ntokens > max_len:\n",
|
||||
" return \". \".join(sentences[:i][:-1]) + \".\"\n",
|
||||
" return \". \".join(sentences[:i]) + \".\"\n",
|
||||
"\n",
|
||||
" return long_text\n",
|
||||
"\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue