diff options
Diffstat (limited to 'ext/fg/js/util.js')
-rw-r--r-- | ext/fg/js/util.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index 59060221..445efa5b 100644 --- a/ext/fg/js/util.js +++ b/ext/fg/js/util.js @@ -152,7 +152,7 @@ function docRangeFromPoint(point, imposter) { return null; } -function docClozeExtract(source, extent) { +function docSentenceExtract(source, extent) { const quotesFwd = {'「': '」', '『': '』', "'": "'", '"': '"'}; const quotesBwd = {'」': '「', '』': '『', "'": "'", '"': '"'}; const terminators = '…。..??!!'; @@ -204,11 +204,11 @@ function docClozeExtract(source, extent) { } } - const sentence = content.substring(startPos, endPos); - const padding = sentence.length - sentence.replace(/^\s+/, ''); + const text = content.substring(startPos, endPos); + const padding = text.length - text.replace(/^\s+/, ''); return { - sentence: sentence.trim(), + text: text.trim(), offset: position - startPos - padding }; } |