From 66d048832f2dc30e11e6be4c68beab23c7d8adef Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 16 May 2021 15:24:38 -0400 Subject: Sentence termination character mode (#1682) * Change enableTerminationCharacters to terminationCharacterMode * Update settings * Update sentence extraction * Update tests * Add tests --- ext/js/data/options-util.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index cb7946f7..cb58206f 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -460,7 +460,8 @@ class OptionsUtil { {async: true, update: this._updateVersion8.bind(this)}, {async: false, update: this._updateVersion9.bind(this)}, {async: true, update: this._updateVersion10.bind(this)}, - {async: true, update: this._updateVersion11.bind(this)} + {async: false, update: this._updateVersion11.bind(this)}, + {async: false, update: this._updateVersion12.bind(this)} ]; } @@ -811,4 +812,15 @@ class OptionsUtil { } return options; } + + _updateVersion12(options) { + // Version 12 changes: + // Changed sentenceParsing.enableTerminationCharacters to sentenceParsing.terminationCharacterMode. + for (const profile of options.profiles) { + const {sentenceParsing} = profile.options; + sentenceParsing.terminationCharacterMode = sentenceParsing.enableTerminationCharacters ? 'custom' : 'newlines'; + delete sentenceParsing.enableTerminationCharacters; + } + return options; + } } -- cgit v1.2.3