summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-19 21:37:11 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-19 21:37:11 -0700
commit8c0ead7a3a0b8897ca12ae1640c9275107f756c9 (patch)
tree5658c16d4351c4af0eddff734a4ad8960cebb732 /ext/bg
parentb02ec434f5da33623802d9d98575582a3c652884 (diff)
Making suru verb work again
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/dictionary.js18
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;
+ }
}