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

paradigmer i samme bøyningsgruppe i samme tabell

parent e6092f9b
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,12 @@
<details title="Klikk for å se bøyninger">
<summary>{{group_list}}</summary>
<div class="inflection">
<div v-for="(lemma, index) in lemmas" :key="index">
<div v-for="(lemma, index) in inflection_groups_by_lemma" :key="index">
<h4>{{lemma.lemma}}</h4>
<component v-for="(std, index) in lemma.paradigm_info"
:key="index"
:is="std.inflection_group.replace('/', '_')"
:standardisations="[std]"></component>
<component v-for="grp in Object.keys(lemma.inflection_groups)"
:key="grp.replace('/', '_')"
:is="grp.replace('/', '_')"
:standardisations="lemma.inflection_groups[grp]"></component>
</div>
</div>
</details>
......@@ -41,6 +41,18 @@ export default {
computed: {
group_list: function() {
return helpers.group_list(this.lemmas)
},
inflection_groups_by_lemma: function() {
return this.lemmas.map(
function(lemma_){
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))
return {
lemma: lemma_.lemma,
inflection_groups: inflection_groups
}
}
)
}
},
components: {
......
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