Widget:Deklinationsklasse ermitteln: Unterschied zwischen den Versionen

Aus KGS-Wiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
Probier es selbst aus! Gib hier den Nominativ und Genitiv eines Substantivs ein und ermittle die Deklinationsklasse!
Probier es selbst aus! Gib hier den Nominativ und Genitiv eines Substantivs ein und ermittle die Deklinationsklasse!


<label for="input-nom">Nominativ:</label><input type="text" id="input-nom" oninput="detectDecl()"/>
<p><label for="input-nom">Nominativ:</label><input type="text" id="input-nom" oninput="detectDecl()"/>
<label for="input-gen">Genitiv:</label><input type="text" id="input-gen" oninput="detectDecl()"/>
<label for="input-gen">Genitiv:</label><input type="text" id="input-gen" oninput="detectDecl()"/></p>
 
{{#mermaid:graph LR
gen -- -i --> geni["Nominativ endet auf …"]
geni --  -es --> e["e-Deklination"]
geni --  -us/-um/-r --> o["o-Deklination"]
gen -- -orum ---> o
gen -- -ae ---> a["a-Deklination"]
gen -- -arum ---> a
gen -- -ūs/-uum ---> u["u-Deklination"]
gen["Genitiv endet auf …"] -- -is --> genis["Nominativ …"]
genis -- endet auf -ar/-e/-al<br/>oder ist gleich Genitiv --> i["i-Deklination"]
genis -- ist etwas anderes --> k["3. Deklination"]
gen -- -ium ---> i
gen -- etwas anderes mit -um ---> k
click a "https://wiki.kah.gs/wiki/a-Deklination"
click e "https://wiki.kah.gs/wiki/e-Deklination"
click i "https://wiki.kah.gs/wiki/i-Deklination"
click k "https://wiki.kah.gs/wiki/3. Deklination"
click o "https://wiki.kah.gs/wiki/o-Deklination"
click u "https://wiki.kah.gs/wiki/u-Deklination"
linkStyle default stroke: lightgray, fill: none;
style geni fill: red;
style o fill: red;
}}
<script>
<script>


function detectDecl() {
function detectDecl() {
document.getElementById('L-gen-genis').children[0].style = "stroke: lightgray; fill: none;"
 
document.getElementById('L-genis-i').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-genis-k').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-geni').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-geni-e').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-geni-o').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-a').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-u').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-i').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-o').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-k').children[0].style = "stroke: lightgray; fill: none;"


let nom = document.getElementById('input-nom').value
let nom = document.getElementById('input-nom').value
let gen = document.getElementById('input-gen').value
let gen = document.getElementById('input-gen').value
if (nom == '' || gen ==  '') {
if (nom == '' || gen ==  '') {
document.getElementById('L-gen-genis').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-genis-i').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-genis-k').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-geni').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-geni-e').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-geni-o').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-a').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-u').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-i').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-o').children[0].style = "stroke: black; fill: none;"
document.getElementById('L-gen-k').children[0].style = "stroke: black; fill: none;"
return
return
} else {
document.getElementById('L-gen-genis').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-genis-i').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-genis-k').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-geni').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-geni-e').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-geni-o').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-a').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-u').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-i').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-o').children[0].style = "stroke: lightgray; fill: none;"
document.getElementById('L-gen-k').children[0].style = "stroke: lightgray; fill: none;"
}
}
if (gen.endsWith('is')) {
if (gen.endsWith('is')) {

Version vom 4. Juli 2024, 07:45 Uhr

Probier es selbst aus! Gib hier den Nominativ und Genitiv eines Substantivs ein und ermittle die Deklinationsklasse!

<label for="input-nom">Nominativ:</label><input type="text" id="input-nom" oninput="detectDecl()"/> <label for="input-gen">Genitiv:</label><input type="text" id="input-gen" oninput="detectDecl()"/>

<script>

function detectDecl() {


let nom = document.getElementById('input-nom').value let gen = document.getElementById('input-gen').value if (nom == || gen == ) { document.getElementById('L-gen-genis').children[0].style = "stroke: black; fill: none;" document.getElementById('L-genis-i').children[0].style = "stroke: black; fill: none;" document.getElementById('L-genis-k').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-geni').children[0].style = "stroke: black; fill: none;" document.getElementById('L-geni-e').children[0].style = "stroke: black; fill: none;" document.getElementById('L-geni-o').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-a').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-u').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-i').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-o').children[0].style = "stroke: black; fill: none;" document.getElementById('L-gen-k').children[0].style = "stroke: black; fill: none;" return } else { document.getElementById('L-gen-genis').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-genis-i').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-genis-k').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-geni').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-geni-e').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-geni-o').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-a').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-u').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-i').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-o').children[0].style = "stroke: lightgray; fill: none;" document.getElementById('L-gen-k').children[0].style = "stroke: lightgray; fill: none;" } if (gen.endsWith('is')) { document.getElementById('L-gen-genis').children[0].style = "stroke: red; fill: none;" if (nom == gen || nom.endsWith('ar') || nom.endsWith('e') || nom.endsWith('al')) { document.getElementById('L-genis-i').children[0].style = "stroke: red; fill: none;" } else { document.getElementById('L-genis-k').children[0].style = "stroke: red; fill: none;" } return } if (gen.endsWith('i')) { document.getElementById('L-gen-geni').children[0].style = "stroke: red; fill: none;" if (nom.endsWith('es')) { document.getElementById('L-geni-e').children[0].style = "stroke: red; fill: none;" } else { document.getElementById('L-geni-o').children[0].style = "stroke: red; fill: none;" } return } if (gen.endsWith('ae') || gen.endsWith('arum')) { document.getElementById('L-gen-a').children[0].style = "stroke: red; fill: none;" return } if (gen.endsWith('us') || gen.endsWith('ūs') || gen.endsWith('uum')) { document.getElementById('L-gen-u').children[0].style = "stroke: red; fill: none;" return } if (gen.endsWith('ium')) { document.getElementById('L-gen-i').children[0].style = "stroke: red; fill: none;" return } if (gen.endsWith('orum')) { document.getElementById('L-gen-o').children[0].style = "stroke: red; fill: none;" return } if (gen.endsWith('um')) { document.getElementById('L-gen-k').children[0].style = "stroke: red; fill: none;" return } } </script>