diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-11 09:18:55 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-11 09:18:55 +0300 |
commit | 4fb983a70cd02c0c0126a26e70d40261d5b2a51d (patch) | |
tree | 5811191bc6974b8c2813abd5d944e0b1661df4f4 /ext/bg/js/database.js | |
parent | e1c5d7a401f1f974da1bedd8600524d982c2c7de (diff) |
add termTags
The dictionary tags field can now have a '\t' in it, and it is used to
separate tags associated with definitions and terms.
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r-- | ext/bg/js/database.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 7a893fc0..1c2194df 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -68,10 +68,12 @@ class Database { const results = []; await this.db.terms.where('expression').equals(term).or('reading').equals(term).each(row => { if (titles.includes(row.dictionary)) { + const tags = row.tags.split('\t'); results.push({ expression: row.expression, reading: row.reading, - tags: dictFieldSplit(row.tags), + tags: dictFieldSplit(tags[0]), + termTags: tags.length > 1 ? dictFieldSplit(tags[1]) : [], rules: dictFieldSplit(row.rules), glossary: row.glossary, score: row.score, @@ -93,10 +95,12 @@ class Database { const results = []; await this.db.terms.where('sequence').equals(sequence).each(row => { if (row.dictionary === mainDictionary) { + const tags = row.tags.split('\t'); results.push({ expression: row.expression, reading: row.reading, - tags: dictFieldSplit(row.tags), + tags: dictFieldSplit(tags[0]), + termTags: tags.length > 1 ? dictFieldSplit(tags[1]) : [], rules: dictFieldSplit(row.rules), glossary: row.glossary, score: row.score, |