()
| 1148 | } |
| 1149 | |
| 1150 | private getGraphemeBoundaries(): number[] { |
| 1151 | if (!this.graphemeBoundaries) { |
| 1152 | this.graphemeBoundaries = [] |
| 1153 | for (const { index } of getGraphemeSegmenter().segment(this.text)) { |
| 1154 | this.graphemeBoundaries.push(index) |
| 1155 | } |
| 1156 | // Add the end of text as a boundary |
| 1157 | this.graphemeBoundaries.push(this.text.length) |
| 1158 | } |
| 1159 | return this.graphemeBoundaries |
| 1160 | } |
| 1161 | |
| 1162 | private wordBoundariesCache?: Array<{ |
| 1163 | start: number |
no test coverage detected