aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-10-07 07:02:50 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-10-07 07:02:50 +0300
commit94d590fc85f87028d8264e93c8ad58c71d0977f2 (patch)
treea4f1bd946674995fed7748b5433dba5fe37a2f93 /ext/bg/js/translator.js
parent981d9eddb69322494589c241d049652c9091ed06 (diff)
merged mode: support audio and tags for terms
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index f959ea35..678bc613 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -84,9 +84,11 @@ class Translator {
const expressions = [];
for (const expression of result.expressions.keys()) {
for (const reading of result.expressions.get(expression).keys()) {
+ const tags = await this.expandTags(result.expressions.get(expression).get(reading), result.dictionary);
expressions.push({
expression: expression,
reading: reading,
+ tags: dictTagsSort(tags),
jmdictTermFrequency: (tags => {
if (tags.has('P')) {
return 'popular';
@@ -109,6 +111,7 @@ class Translator {
const strayDefinitions = definitionsBySequence['-1'].filter((definition, index) => !mergedByTermIndices.has(index));
for (const groupedDefinition of dictTermsGroup(strayDefinitions, dictionaries)) {
+ groupedDefinition.expressions = [{expression: groupedDefinition.expression, reading: groupedDefinition.reading}];
definitionsMerged.push(groupedDefinition);
}