From 194f4fc225fa54f26a8b4917aa3dbdedf8026350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no> Date: Thu, 24 Sep 2020 08:18:37 +0200 Subject: [PATCH] =?UTF-8?q?Adjektiv-gruppene=20p=C3=A5=20plass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.vue | 35 ++++++-------- src/components/inflection/Adjective.vue | 49 ++++++++++++++++++++ src/components/inflection/AdjectiveAdv.vue | 36 +++++++++++++++ src/components/inflection/AdjectiveMF.vue | 51 +++++++++++++++++++++ src/components/inflection/AdjectiveMF_F.vue | 51 +++++++++++++++++++++ 5 files changed, 201 insertions(+), 21 deletions(-) create mode 100644 src/components/inflection/Adjective.vue create mode 100644 src/components/inflection/AdjectiveAdv.vue create mode 100644 src/components/inflection/AdjectiveMF.vue create mode 100644 src/components/inflection/AdjectiveMF_F.vue diff --git a/src/components/Header.vue b/src/components/Header.vue index 9c2659b..be7ef41 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 0000000..9acaa8e --- /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 0000000..5c66eb8 --- /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 0000000..1014488 --- /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 0000000..d239415 --- /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> -- GitLab