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

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <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 { loadNounConventions } from '~/src/data.ts';
import { MorphemeValues } from '~/src/language/morphemes.ts'; import { MorphemeValues } from '~/src/language/morphemes.ts';
import type { NounConvention } from '~/src/nouns.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' const nounConvention = typeof route.params.convention === 'string'
? findNounConvention(route.params.convention) ? findNounConvention(route.params.convention)
: undefined; : 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> </script>
<template> <template>
@ -66,6 +97,21 @@ const nounConvention = typeof route.params.convention === 'string'
:morpheme-values="new MorphemeValues(nounConvention.morphemes)" :morpheme-values="new MorphemeValues(nounConvention.morphemes)"
/> />
</section> </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> </template>
</Page> </Page>
</template> </template>

View File

@ -36,10 +36,22 @@ export interface NounConvention {
warning?: string; warning?: string;
description?: string[]; description?: string[];
morphemes: Record<string, MorphemeValue | 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 { export interface NounConventions {
morphemes: string[]; morphemes: string[];
grammarTables: GrammarTableDefinition[]; grammarTables: GrammarTableDefinition[];
declensions: Record<string, NounDeclension>;
conventions: Record<string, NounConvention>; conventions: Record<string, NounConvention>;
} }