summaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-07 20:38:40 -0500
committerGitHub <noreply@github.com>2021-03-07 20:38:40 -0500
commit643dbfb12a66b98b2fabe82416322f0218474567 (patch)
tree9746ca8eadd4c8a28d1b72c5ddcc7632feaab9d2 /ext/js/display
parent19f6bf5a3a669cda311e5a3f162131d8a9823aef (diff)
Refactor term frequency data (#1503)
* Add getTermFrequency * Update DisplayGenerator to use getTermFrequency * Remove termFrequency from Translator data * Backwards compatibility * Update tests
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display-generator.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index c0945781..3977815b 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -230,7 +230,7 @@ class DisplayGenerator {
// Private
_createTermExpression(details) {
- const {termFrequency, expression, reading, termTags, pitches} = details;
+ const {expression, reading, termTags, pitches} = details;
const searchQueries = [];
if (expression) { searchQueries.push(expression); }
@@ -242,7 +242,7 @@ class DisplayGenerator {
const tagContainer = node.querySelector('.expression-tag-list');
node.dataset.readingIsSame = `${reading === expression}`;
- node.dataset.frequency = termFrequency;
+ node.dataset.frequency = DictionaryDataUtil.getTermFrequency(termTags);
const pitchAccentCategories = this._getPitchAccentCategories(pitches);
if (pitchAccentCategories !== null) {