aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/options-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-09-26 11:08:16 -0400
committerGitHub <noreply@github.com>2021-09-26 11:08:16 -0400
commit9899727d7d53caed4c5b5e68176f7ed7f90a9438 (patch)
tree3d764007cf8e86cee23be969a2065a644b27f73d /ext/js/data/options-util.js
parent88e71f82232781a1bc16701ce4719d770222ec4c (diff)
Frequency dictionary sort (#1938)
* Add sortDictionary/sortDictionaryOrder options * Update options * Add API.getTermFrequencies * Add settings * Implement frequency dictionary sorting * Update test * Update test data * Fix handling of undefined rank-based frequencies
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r--ext/js/data/options-util.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index 30ffadb1..c8ab2d01 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -463,7 +463,8 @@ class OptionsUtil {
{async: false, update: this._updateVersion11.bind(this)},
{async: true, update: this._updateVersion12.bind(this)},
{async: true, update: this._updateVersion13.bind(this)},
- {async: false, update: this._updateVersion14.bind(this)}
+ {async: false, update: this._updateVersion14.bind(this)},
+ {async: false, update: this._updateVersion15.bind(this)}
];
if (typeof targetVersion === 'number' && targetVersion < result.length) {
result.splice(targetVersion);
@@ -876,4 +877,15 @@ class OptionsUtil {
}
return options;
}
+
+ _updateVersion15(options) {
+ // Version 15 changes:
+ // Added general.sortFrequencyDictionary.
+ // Added general.sortFrequencyDictionaryOrder.
+ for (const profile of options.profiles) {
+ profile.options.general.sortFrequencyDictionary = null;
+ profile.options.general.sortFrequencyDictionaryOrder = 'descending';
+ }
+ return options;
+ }
}