Skip to content

Commit

Permalink
group umlaut cases in test file and add noun cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hannaw93 committed Nov 29, 2024
1 parent 89aeb59 commit 99c6d11
Showing 1 changed file with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ const morphologyDataDE = getMorphologyData( "de" ).de;
const wordsToStem = [
// Default stemmer
[ "studenten", "student" ],
// Nouns that gets umlaut in plural
[ "vögel", "vogel" ],
[ "läden", "laden" ],
// A noun that gets umlaut and -e in plural
[ "häuse", "haus" ],
[ "ängste", "angst" ],
// A noun that gets umlaut and -er in plural
[ "männer", "mann" ],
[ "wörter", "wort" ],
// compound noun that gets umlaut in plural
[ "raubvögel", "raubvogel" ],
// compound noun that gets umlaut and -e in plural
[ "landflüchte", "landflucht" ],
// Nouns: exceptionStems with one plural matching multiple singulars
[ "stadium", "stadi" ],
[ "stadion", "stadi" ],
Expand Down Expand Up @@ -71,7 +58,33 @@ describe.each( wordsToStem )( "Test for determining stems for German words", ( w
} );

const umlautExceptions = [
// A noun that gets umlaut in plural
[ "vögel", "vogel" ],
[ "läden", "laden" ],
// A noun that gets umlaut and an irregular plural dative suffix
[ "müttern", "mutter" ],
[ "schwägern", "schwager" ],
// A noun that gets umlaut and a regular case suffix
[ "bädern", "bad" ],
[ "ängsten", "angst" ],
[ "hände", "hand" ],
// A noun that gets umlaut and -e in plural
[ "häuse", "haus" ],
[ "ängste", "angst" ],
// A noun that gets umlaut and -er in plural
[ "männer", "mann" ],
[ "wörter", "wort" ],
// compound noun that gets umlaut in plural
[ "raubvögel", "raubvogel" ],
// compound noun that gets umlaut and -e in plural
[ "landflüchte", "landflucht" ],
[ "geschwülst", "geschwulst" ],
[ "feuersbrünst", "feuersbrunst" ],
[ "hirschbrünft", "hirschbrunft" ],
[ "brünst", "brunst" ],
[ "lebensbrünst", "lebensbrunst" ],
[ "liebesbrünst", "liebesbrunst" ],
// More umlaut nouns from all groups
[ "schwäger", "schwager" ],
[ "schäden", "schaden" ],
[ "töchter", "tochter" ],
Expand All @@ -89,11 +102,6 @@ const umlautExceptions = [
[ "häls", "hal" ],
[ "äxte", "axt" ],
[ "äste", "ast" ],
[ "feuersbrünst", "feuersbrunst" ],
[ "hirschbrünft", "hirschbrunft" ],
[ "brünst", "brunst" ],
[ "lebensbrünst", "lebensbrunst" ],
[ "liebesbrünst", "liebesbrunst" ],
];

describe.each( umlautExceptions )( "Test for determining stems for German words with umlauts", ( word, stem ) => {
Expand Down

0 comments on commit 99c6d11

Please sign in to comment.