summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-07 12:41:09 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-07 12:41:09 -0700
commitd3272efef7687d08d5c2a36b27328771db522f37 (patch)
tree69fa6ee6943f6169bf53b9a2fdd966192454c0d1
parent024ec83251d05b966ceeb90fd1a531b36567b31b (diff)
Get rid of addon hack
-rw-r--r--ext/bg/js/deinflector.js4
-rw-r--r--ext/bg/js/dictionary.js20
-rw-r--r--ext/bg/js/translator.js4
3 files changed, 2 insertions, 26 deletions
diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js
index 6520cbc0..194dbab6 100644
--- a/ext/bg/js/deinflector.js
+++ b/ext/bg/js/deinflector.js
@@ -52,10 +52,6 @@ class Deinflection {
for (let v of variants) {
let allowed = this.tags.length === 0;
for (let tag of this.tags) {
- //
- // TODO: Handle addons through tags.json or rules.json
- //
-
if (v.ti.indexOf(tag) !== -1) {
allowed = true;
break;
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 073b8f55..f312796d 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -44,29 +44,13 @@ class Dictionary {
results = results.concat(
indices.map(index => {
const [e, r, t, ...g] = dict.d[index];
- const tags = t.split(' ');
-
- //
- // TODO: Handle addons through data.
- //
-
- const addons = [];
- for (let tag of tags) {
- if (tag.startsWith('v5') && tag !== 'v5') {
- addons.push('v5');
- } else if (tag.startsWith('vs-')) {
- addons.push('vs');
- }
- }
-
return {
- id: index,
expression: e,
reading: r,
+ tags: t.split(' '),
glossary: g,
- tags: tags.concat(addons),
entities: dict.e,
- addons: addons
+ id: index
};
})
);
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 000271b6..f2107b9f 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -168,10 +168,6 @@ class Translator {
let popular = false;
let tagItems = [];
for (let tag of entry.tags) {
- if (entry.addons.indexOf(tag) !== -1) {
- continue;
- }
-
const tagItem = {
class: 'default',
order: Number.MAX_SAFE_INTEGER,