Widget:Deklinationsklasse ermitteln
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 (gen.endsWith('is')) { document.getElementById('L-gen-genis').children[0].style = "stroke: red; fill: none;" if (nom == gen or nom.endsWith('ar') or nom.endsWith('e') or 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') or gen.endsWith('arum')) { document.getElementById('L-gen-a').children[0].style = "stroke: red; fill: none;" return } if (gen.endsWith('us') or gen.endsWith('ūs') or gen.endsWith('uum')) { document.getElementById('L-gen-a').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('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>