diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-19 21:37:11 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-19 21:37:11 -0700 |
commit | 8c0ead7a3a0b8897ca12ae1640c9275107f756c9 (patch) | |
tree | 5658c16d4351c4af0eddff734a4ad8960cebb732 /ext/bg/js | |
parent | b02ec434f5da33623802d9d98575582a3c652884 (diff) |
Making suru verb work again
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/dictionary.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index 6870601e..4645189d 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -41,7 +41,8 @@ class Dictionary { results = results.concat( indices.map(index => { const [e, r, t, ...g] = dict.defs[index]; - return {id: index, expression: e, reading: r, glossary: g, tags: t.split(' ')}; + const tags = Dictionary.fixupTags(t.split(' ')); + return {id: index, expression: e, reading: r, glossary: g, tags: tags}; }) ); } @@ -62,4 +63,19 @@ class Dictionary { return results; } + + static fixupTags(tags) { + const results = []; + for (const tag of tags) { + if (tag.startsWith('v5') && tag !== 'v5') { + results.push('v5'); + } else if (tag.startsWith('vs-')) { + results.push('vs'); + } + + results.push(tag); + } + + return results; + } } |