diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-19 18:35:42 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-19 18:35:42 +0300 |
commit | f54f909701453bac563c9cb5ec75fde23e087e8e (patch) | |
tree | 856e4253b6fc51a2df8421a5c69fe84b36f53092 /ext/bg/js/translator.js | |
parent | 04def645214b4c0ae2833f5ea7d9c3274192aa09 (diff) |
merged mode: rewrite term frequency (use score)
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r-- | ext/bg/js/translator.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index 4394e172..22c5022f 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -113,15 +113,15 @@ class Translator { expression: expression, reading: reading, termTags: dictTagsSort(tags), - jmdictTermFrequency: (tags => { - if (tags.has('P')) { + termFrequency: (score => { + if (score > 0) { return 'popular'; - } else if (dictJmdictTermTagsRare(tags)) { + } else if (score < 0) { return 'rare'; } else { return 'normal'; } - })(result.expressions.get(expression).get(reading)) + })(dictTermTagScore(result.expressions.get(expression).get(reading))) }); } } |