diff --git a/src/components/Header.vue b/src/components/Header.vue index 9c2659bee62403c0b462566742fa07b5fff0c9d4..be7ef41c0914bdd474d7972b1764adcb2f1f0c3e 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,3 +1,4 @@ +<!-- eslint-disable --> <template> <div> <h1 class="article_header" v-for="(lemma, index) in lemmas" :key="index"> @@ -7,15 +8,10 @@ <div class="inflection"> <div v-for="(lemma, index) in lemmas" :key="index"> <h4>{{lemma.lemma}}</h4> - <table v-for="(std, index) in lemma.paradigm_info" :key="index"> - <tr> - <th rowspan="2">{{std.tags ? std.tags.join(', ') : ''}}</th> - <th v-for="(inflection, index) in std.inflection" :key="index">{{inflection.tags.join(', ')}}</th> - </tr> - <tr> - <td v-for="(inflection, index) in std.inflection" :key="index">{{inflection.word_form}}</td> - </tr> - </table> + <component v-for="(std, index) in lemma.paradigm_info" + :key="index" + :is="std.inflection_group.replace('/', '_')" + :standardisations="[std]"></component> </div> </div> </details> @@ -23,7 +19,12 @@ </template> <script> + /* eslint-disable */ import helpers from '../utils/helpers.js' +import ADJ from './inflection/Adjective.vue' +import ADJ_adv from './inflection/AdjectiveAdv.vue' +import ADJ_masc_fem from './inflection/AdjectiveMF.vue' +import ADJ_masc_fem_fem from './inflection/AdjectiveMF_F.vue' export default { name: 'Header', @@ -36,6 +37,10 @@ export default { } }, components: { + ADJ, + ADJ_adv, + ADJ_masc_fem, + ADJ_masc_fem_fem } } </script> @@ -54,18 +59,6 @@ h1.article_header { display: inline; } -.inflection table { - border-collapse: collapse; - margin: 10px; -} - -.inflection td, .inflection th { - border: solid; - border-width: 1px; - margin: 0px 0px 0px 0px; - padding: 3px; -} - details > summary { padding: 2px 6px; width: 15em; diff --git a/src/components/inflection/Adjective.vue b/src/components/inflection/Adjective.vue new file mode 100644 index 0000000000000000000000000000000000000000..9acaa8e88b46f7671a7ae435e994b6da230b5c8d --- /dev/null +++ b/src/components/inflection/Adjective.vue @@ -0,0 +1,49 @@ +<template> + <table> + <tr> + <th rowspan="2">Adjektiv</th><th colspan="3">Entall</th><th>Flertall</th><th colspan="3">Gradbøying</th> + </tr> + <tr> + <th>Hankjønn og hunkjønn</th> + <th>Intetkjønn</th> + <th>Bestemt form</th> + <th></th> + <th>Komparativ</th> + <th>Superlativ</th> + <th>Superlativ, bestemt form</th> + </tr> + <tr v-for="(std, index) in standardisations" :key="index"> + <td></td> + <td>{{std.inflection[0].word_form}}</td> + <td>{{std.inflection[3].word_form}}</td> + <td>{{std.inflection[2].word_form}}</td> + <td>{{std.inflection[1].word_form}}</td> + <td>{{std.inflection[4].word_form}}</td> + <td>{{std.inflection[5].word_form}}</td> + <td>{{std.inflection[6].word_form}}</td> + </tr> + </table> +</template> + +<script> +export default { + name: "ADJ", + props: { + standardisations: Array + } +} +</script> + +<style scoped> + table { + border-collapse: collapse; + margin: 10px; + } + + td, th { + border: solid; + border-width: 1px; + margin: 0px 0px 0px 0px; + padding: 3px; + } +</style> diff --git a/src/components/inflection/AdjectiveAdv.vue b/src/components/inflection/AdjectiveAdv.vue new file mode 100644 index 0000000000000000000000000000000000000000..5c66eb8fb85d1685e29c8fde1ff1019a1a2162c3 --- /dev/null +++ b/src/components/inflection/AdjectiveAdv.vue @@ -0,0 +1,36 @@ +<template> + <table> + <tr> + <th>Adjektiv, adverbtype</th><th>Positiv</th><th>Komparativ</th><th>Superlativ</th> + </tr> + <tr v-for="(std, index) in standardisations" :key="index"> + <td></td> + <td>{{std.inflection[0].word_form}}</td> + <td>{{std.inflection[1].word_form}}</td> + <td>{{std.inflection[2].word_form}}</td> + </tr> + </table> +</template> + +<script> +export default { + name: "ADJ_adv", + props: { + standardisations: Array + } +} +</script> + +<style scoped> + table { + border-collapse: collapse; + margin: 10px; + } + + td, th { + border: solid; + border-width: 1px; + margin: 0px 0px 0px 0px; + padding: 3px; + } +</style> diff --git a/src/components/inflection/AdjectiveMF.vue b/src/components/inflection/AdjectiveMF.vue new file mode 100644 index 0000000000000000000000000000000000000000..10144882df152f0899acc7b59810a129a82afb34 --- /dev/null +++ b/src/components/inflection/AdjectiveMF.vue @@ -0,0 +1,51 @@ +<template> + <table> + <tr> + <th rowspan="2">Adjektiv</th><th colspan="4">Entall</th><th>Flertall</th><th colspan="3">Gradbøying</th> + </tr> + <tr> + <th>Hankjønn</th> + <th>Hokjønn</th> + <th>Inkjekjønn</th> + <th>Bunden form</th> + <th></th> + <th>Komparativ</th> + <th>Superlativ</th> + <th>Superlativ, bunden form</th> + </tr> + <tr v-for="(std, index) in standardisations" :key="index"> + <td></td> + <td>{{std.inflection[0].word_form}}</td> + <td>{{std.inflection[1].word_form}}</td> + <td>{{std.inflection[2].word_form}}</td> + <td>{{std.inflection[3].word_form}}</td> + <td>{{std.inflection[4].word_form}}</td> + <td>{{std.inflection[5].word_form}}</td> + <td>{{std.inflection[6].word_form}}</td> + <td>{{std.inflection[7].word_form}}</td> + </tr> + </table> +</template> + +<script> +export default { + name: "ADJ_masc_fem", + props: { + standardisations: Array + } +} +</script> + +<style scoped> + table { + border-collapse: collapse; + margin: 10px; + } + + td, th { + border: solid; + border-width: 1px; + margin: 0px 0px 0px 0px; + padding: 3px; + } +</style> diff --git a/src/components/inflection/AdjectiveMF_F.vue b/src/components/inflection/AdjectiveMF_F.vue new file mode 100644 index 0000000000000000000000000000000000000000..d239415f74b8155bfd7e7ed616acfd918e0ee414 --- /dev/null +++ b/src/components/inflection/AdjectiveMF_F.vue @@ -0,0 +1,51 @@ +<template> + <table> + <tr> + <th rowspan="2">Adjektiv</th><th colspan="4">Entall</th><th>Flertall</th><th colspan="3">Gradbøying</th> + </tr> + <tr> + <th>Hankjønn/Hokjønn</th> + <th>Hokjønn</th> + <th>Inkjekjønn</th> + <th>Bunden form</th> + <th></th> + <th>Komparativ</th> + <th>Superlativ</th> + <th>Superlativ, bunden form</th> + </tr> + <tr v-for="(std, index) in standardisations" :key="index"> + <td></td> + <td>{{std.inflection[0].word_form}}</td> + <td>{{std.inflection[1].word_form}}</td> + <td>{{std.inflection[2].word_form}}</td> + <td>{{std.inflection[3].word_form}}</td> + <td>{{std.inflection[4].word_form}}</td> + <td>{{std.inflection[5].word_form}}</td> + <td>{{std.inflection[6].word_form}}</td> + <td>{{std.inflection[7].word_form}}</td> + </tr> + </table> +</template> + +<script> +export default { + name: "ADJ_masc_fem_fem", + props: { + standardisations: Array + } +} +</script> + +<style scoped> + table { + border-collapse: collapse; + margin: 10px; + } + + td, th { + border: solid; + border-width: 1px; + margin: 0px 0px 0px 0px; + padding: 3px; + } +</style>