Repository navigation
Commit febedd3
committed
fix: Stop TextChunker once a chunk reaches the end of the text
The sliding window kept advancing after the last word was covered, so
a leftover window with at least min_chunk_size words was emitted as an
extra chunk whose words were all in the previous chunk. Break out of
the loop right after the chunk that reaches the end of the text.
Fixes #7063
Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>1 parent 1e5e90c commit febedd3
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
| |||
0 commit comments