Skip to content
Snippets Groups Projects
Commit df028d16 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

filtrerer vekk ubøyelige paradigmer

parent e9735514
No related branches found
No related tags found
No related merge requests found
...@@ -43,13 +43,14 @@ export default { ...@@ -43,13 +43,14 @@ export default {
return helpers.group_list(this.lemmas) return helpers.group_list(this.lemmas)
}, },
inflection_groups_by_lemma: function() { inflection_groups_by_lemma: function() {
let components = Object.keys(this.$options.components)
return this.lemmas.map( return this.lemmas.map(
function(lemma_){ function(lemma_){
let inflection_groups = lemma_.paradigm_info.reduce((acc, std) => Object.assign(acc, {[std.inflection_group]: []}), {}) let inflection_groups = lemma_.paradigm_info.reduce((acc, std) => Object.assign(acc, {[std.inflection_group]: []}), {})
lemma_.paradigm_info.forEach(std => inflection_groups[std.inflection_group].push(std)) lemma_.paradigm_info.forEach(std => inflection_groups[std.inflection_group].push(std))
return { return {
lemma: lemma_.lemma, lemma: lemma_.lemma,
inflection_groups: inflection_groups inflection_groups: Object.fromEntries(Object.entries(inflection_groups).filter(e => components.includes(e[0])))
} }
} }
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment