rename pos to partOfSpeech

This commit is contained in:
siikamiika 2017-10-13 03:14:06 +03:00
parent 7ec28bea54
commit 4203fda906
2 changed files with 7 additions and 7 deletions

View File

@ -112,11 +112,11 @@ function dictTermsUndupe(definitions) {
function dictTermsCompressTags(definitions) { function dictTermsCompressTags(definitions) {
let lastDictionary = ''; let lastDictionary = '';
let lastPos = ''; let lastPartOfSpeech = '';
for (const definition of definitions) { for (const definition of definitions) {
const dictionary = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'dictionary').map(tag => tag.name).sort()); const dictionary = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'dictionary').map(tag => tag.name).sort());
const pos = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'pos').map(tag => tag.name).sort()); const partOfSpeech = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'partOfSpeech').map(tag => tag.name).sort());
const filterOutCategories = []; const filterOutCategories = [];
@ -124,13 +124,13 @@ function dictTermsCompressTags(definitions) {
filterOutCategories.push('dictionary'); filterOutCategories.push('dictionary');
} else { } else {
lastDictionary = dictionary; lastDictionary = dictionary;
lastPos = ''; lastPartOfSpeech = '';
} }
if (lastPos === pos) { if (lastPartOfSpeech === partOfSpeech) {
filterOutCategories.push('pos'); filterOutCategories.push('partOfSpeech');
} else { } else {
lastPos = pos; lastPartOfSpeech = partOfSpeech;
} }
definition.definitionTags = definition.definitionTags.filter(tag => !filterOutCategories.includes(tag.category)); definition.definitionTags = definition.definitionTags.filter(tag => !filterOutCategories.includes(tag.category));

View File

@ -92,7 +92,7 @@ hr {
background-color: #5cb85c; background-color: #5cb85c;
} }
.tag-pos { .tag-partOfSpeech {
background-color: #565656; background-color: #565656;
} }