diff options
Diffstat (limited to 'ext/mixed/js/dictionary-data-util.js')
-rw-r--r-- | ext/mixed/js/dictionary-data-util.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/mixed/js/dictionary-data-util.js b/ext/mixed/js/dictionary-data-util.js index 709f4ead..761bfc1c 100644 --- a/ext/mixed/js/dictionary-data-util.js +++ b/ext/mixed/js/dictionary-data-util.js @@ -17,20 +17,17 @@ class DictionaryDataUtil { static getPitchAccentInfos(definition) { - const {type} = definition; - if (type === 'kanji') { return []; } + if (definition.type === 'kanji') { return []; } const results = new Map(); const allExpressions = new Set(); const allReadings = new Set(); - const sources = [definition]; - for (const {pitches: expressionPitches, expression} of sources) { + for (const {expression, reading, pitches: expressionPitches} of definition.expressions) { allExpressions.add(expression); + allReadings.add(reading); - for (const {reading, pitches, dictionary} of expressionPitches) { - allReadings.add(reading); - + for (const {pitches, dictionary} of expressionPitches) { let dictionaryResults = results.get(dictionary); if (typeof dictionaryResults === 'undefined') { dictionaryResults = []; |