(de)(nouns) show sample declension for noun conventions

This commit is contained in:
Valentyne Stigloher 2025-04-02 20:47:34 +02:00
parent f054e35be2
commit 4a7a0410ab
3 changed files with 243 additions and 0 deletions

View File

@ -47,6 +47,123 @@ grammarTables:
variants:
base: 'adjective'
type: 'adjective-declension-with-case'
declensions:
s6:
singular:
n: ''
g: 's'
d: ''
a: ''
plural:
n: ''
g: ''
d: 'n'
a: ''
w1b:
singular:
n: ''
g: 'en'
d: 'en'
a: 'en'
plural:
n: 'en'
g: 'en'
d: 'en'
a: 'en'
w2b:
singular:
n: ''
g: ''
d: ''
a: ''
plural:
n: 'en'
g: 'en'
d: 'en'
a: 'en'
x1:
singular:
n: ''
g: ''
d: ''
a: ''
plural:
n: 'nen'
g: 'nen'
d: 'nen'
a: 'nen'
x2:
singular:
n: ''
g: 's'
d: ''
a: ''
plural:
n: ''
g: ''
d: ''
a: ''
x3:
singular:
n: ''
g: 's'
d: ''
a: ''
plural:
n: 's'
g: 's'
d: 's'
a: 's'
x4:
singular:
n: 'e'
g: 'es'
d: 'e'
a: 'e'
plural:
n: 'ne'
g: 'ne'
d: 'ne'
a: 'nen'
x5:
singular:
n: ''
g: ''
d: ''
a: ''
plural:
n: ''
g: ''
d: ''
a: ''
x6:
singular:
n: ''
g: 's'
d: ''
a: ''
plural:
n: 'nen'
g: 'nen'
d: 'nen'
a: 'nen'
x7:
singular:
n: 'u'
g: 'us'
d: 'u'
a: 'u'
plural:
n: 'oj'
g: 'oj'
d: 'ojn'
a: 'oj'
x8:
singular:
n: ''
g: ''
d: ''
a: ''
conventions:
maskulinum:
name: 'Maskulinum'
@ -72,6 +189,10 @@ conventions:
adjective_strong_g: 'en'
adjective_strong_d: 'em'
adjective_strong_a: 'en'
templates:
arbeit:
suffix: 'er'
declension: 's6'
femininum:
name: 'Femininum'
normative: true
@ -96,6 +217,10 @@ conventions:
adjective_strong_g: 'er'
adjective_strong_d: 'er'
adjective_strong_a: 'e'
templates:
arbeit:
suffix: 'erin'
declension: 'x1'
diminuitiv:
name: 'Diminuitiv'
normative: true
@ -125,6 +250,10 @@ conventions:
adjective_strong_g: 'en'
adjective_strong_d: 'em'
adjective_strong_a: 'es'
templates:
arbeit:
suffix: 'erchen'
declension: 'x2'
person-formen:
name: 'Person-Formen'
normative: true
@ -149,6 +278,10 @@ conventions:
adjective_strong_g: 'er'
adjective_strong_d: 'er'
adjective_strong_a: 'e'
templates:
arbeit:
suffix: 'sperson'
declension: 'w2b'
mensch-formen:
name: 'Mensch-Formen'
normative: true
@ -173,6 +306,10 @@ conventions:
adjective_strong_g: 'en'
adjective_strong_d: 'em'
adjective_strong_a: 'en'
templates:
arbeit:
suffix: 'smensch'
declension: 'w1b'
y-formen:
name: 'Y-Formen'
normative: false
@ -201,6 +338,10 @@ conventions:
adjective_strong_g: 'en'
adjective_strong_d: 'em'
adjective_strong_a: 'es'
templates:
arbeit:
suffix: 'y'
declension: 'x3'
i-formen:
name: 'I-Formen'
normative: false
@ -235,6 +376,10 @@ conventions:
adjective_strong_g: 'en'
adjective_strong_d: 'em'
adjective_strong_a: 'es'
templates:
arbeit:
suffix: 'i'
declension: 'x3'
inklusivum:
name: 'Inklusivum'
normative: false
@ -262,6 +407,10 @@ conventions:
adjective_strong_g: 'ers'
adjective_strong_d: 'erm'
adjective_strong_a: 'ey'
templates:
arbeit:
suffix: 'er'
declension: 'x4'
indefinitivum:
name: 'Indefinitivum'
normative: false
@ -285,6 +434,10 @@ conventions:
adjective_mixed_g: 'en'
adjective_mixed_d: 'en'
adjective_mixed_a: 'in'
templates:
arbeit:
suffix: 'ernin'
declension: 'x6'
ens-formen:
name: 'ens-Formen'
normative: false
@ -301,6 +454,10 @@ conventions:
adjective_weak_g: 'e'
adjective_weak_d: 'e'
adjective_weak_a: 'e'
templates:
arbeit:
suffix: 'ens'
declension: 'x5'
ex-formen:
name: 'ex-Formen'
normative: false
@ -311,6 +468,10 @@ conventions:
„ex“ steht für Exit Gender und soll in Abgrenzung zu anderen Formen explizit beschreiben,
dass sich eine Person nicht über Gender versteht.
morphemes: {}
templates:
arbeit:
suffix: 'ex'
declension: 'x8'
ojum:
name: 'Ojum'
normative: false
@ -329,6 +490,10 @@ conventions:
article_g: 'dejs'
article_d: 'dojm'
article_a: 'dojn'
templates:
arbeit:
suffix: ''
declension: 'x7'
nona-system:
name: 'NoNa-System'
normative: false
@ -351,6 +516,10 @@ conventions:
adjective_mixed_g: 'er'
adjective_mixed_d: 'em'
adjective_mixed_a: 'e'
templates:
arbeit:
suffix: 'er*in'
declension: 'x1'
genderdoppelpunkt:
name: 'Genderdoppelpunkt'
normative: false
@ -375,6 +544,10 @@ conventions:
adjective_strong_g: 'er:n'
adjective_strong_d: 'er:m'
adjective_strong_a: 'e:n'
templates:
arbeit:
suffix: 'er:in'
declension: 'x1'
gendergap:
name: 'Gendergap'
normative: false
@ -399,6 +572,10 @@ conventions:
adjective_strong_g: 'er_n'
adjective_strong_d: 'er_m'
adjective_strong_a: 'e_n'
templates:
arbeit:
suffix: 'er_in'
declension: 'x1'
gendersternchen:
name: 'Gendersternchen'
normative: false
@ -423,6 +600,10 @@ conventions:
adjective_strong_g: 'er*n'
adjective_strong_d: 'er*m'
adjective_strong_a: 'e*n'
templates:
arbeit:
suffix: 'er*in'
declension: 'x1'
binnen-i:
name: 'Binnen-I'
normative: false
@ -451,3 +632,7 @@ conventions:
adjective_strong_g: 'eRn'
adjective_strong_d: 'eRm'
adjective_strong_a: 'En'
templates:
arbeit:
suffix: 'erIn'
declension: 'x1'

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import { cases } from '~/locale/de/language/grammarTableVariantsConverter.ts';
import { NounDeclension } from '~/src/classes.ts';
import { loadNounConventions } from '~/src/data.ts';
import { MorphemeValues } from '~/src/language/morphemes.ts';
import type { NounConvention } from '~/src/nouns.ts';
@ -24,6 +26,35 @@ const findNounConvention = (nounConventionKey: string): NounConvention | undefin
const nounConvention = typeof route.params.convention === 'string'
? findNounConvention(route.params.convention)
: undefined;
const stem = 'Arbeit';
const pluralArticles: Record<string, string> = {
n: 'die',
g: 'der',
d: 'den',
a: 'die',
};
const declension = computed(() => {
if (nounConventions === undefined || nounConvention === undefined) {
return undefined;
}
const template = nounConvention.templates.arbeit;
const declension = nounConventions.declensions[template.declension];
const singular = Object.entries(declension.singular ?? {}).map(([caseAbbreviation, declensionSuffix]) => {
return [caseAbbreviation.toUpperCase(),
`${nounConvention.morphemes[`article_${caseAbbreviation}`] ?? ''} ${stem}${template.suffix}${declensionSuffix}`];
});
const plural = Object.entries(declension.plural ?? {}).map(([caseAbbreviation, declensionSuffix]) => {
return [`${caseAbbreviation.toUpperCase()}_pl`,
`${pluralArticles[caseAbbreviation]} ${stem}${template.suffix}${declensionSuffix}`];
});
return new NounDeclension(Object.fromEntries([...singular, ...plural]));
});
</script>
<template>
@ -66,6 +97,21 @@ const nounConvention = typeof route.params.convention === 'string'
:morpheme-values="new MorphemeValues(nounConvention.morphemes)"
/>
</section>
<section v-if="declension">
<div class="mb-3">
<h5 class="h6">
<T>nouns.singular</T>
</h5>
<NounsDeclension word="" :template="declension" open />
</div>
<div v-if="Object.keys(declension.plural).length > 0" class="mb-3">
<h5 class="h6">
<T>nouns.plural</T>
</h5>
<NounsDeclension word="" :template="declension" open plural />
</div>
</section>
</template>
</Page>
</template>

View File

@ -36,10 +36,22 @@ export interface NounConvention {
warning?: string;
description?: string[];
morphemes: Record<string, MorphemeValue | string>;
templates: Record<string, NounConventionTemplate>;
}
interface NounConventionTemplate {
suffix: string;
declension: string;
}
export interface NounDeclension {
singular?: Record<string, string>;
plural?: Record<string, string>;
}
export interface NounConventions {
morphemes: string[];
grammarTables: GrammarTableDefinition[];
declensions: Record<string, NounDeclension>;
conventions: Record<string, NounConvention>;
}