Get rid of addon hack

This commit is contained in:
Alex Yatskov 2016-08-07 12:41:09 -07:00
parent 024ec83251
commit d3272efef7
3 changed files with 2 additions and 26 deletions

View File

@ -52,10 +52,6 @@ class Deinflection {
for (let v of variants) { for (let v of variants) {
let allowed = this.tags.length === 0; let allowed = this.tags.length === 0;
for (let tag of this.tags) { for (let tag of this.tags) {
//
// TODO: Handle addons through tags.json or rules.json
//
if (v.ti.indexOf(tag) !== -1) { if (v.ti.indexOf(tag) !== -1) {
allowed = true; allowed = true;
break; break;

View File

@ -44,29 +44,13 @@ class Dictionary {
results = results.concat( results = results.concat(
indices.map(index => { indices.map(index => {
const [e, r, t, ...g] = dict.d[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 { return {
id: index,
expression: e, expression: e,
reading: r, reading: r,
tags: t.split(' '),
glossary: g, glossary: g,
tags: tags.concat(addons),
entities: dict.e, entities: dict.e,
addons: addons id: index
}; };
}) })
); );

View File

@ -168,10 +168,6 @@ class Translator {
let popular = false; let popular = false;
let tagItems = []; let tagItems = [];
for (let tag of entry.tags) { for (let tag of entry.tags) {
if (entry.addons.indexOf(tag) !== -1) {
continue;
}
const tagItem = { const tagItem = {
class: 'default', class: 'default',
order: Number.MAX_SAFE_INTEGER, order: Number.MAX_SAFE_INTEGER,