Skip to content

Commit

Permalink
Merge pull request #32209 from vespa-engine/bratseth/more-languages
Browse files Browse the repository at this point in the history
Handle all languages already supported by OpenNlp
  • Loading branch information
bratseth authored Aug 21, 2024
2 parents b666cc6 + 00bf9af commit c48ca65
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,17 @@ private Stemmer stemmerFor(Language language, StemMode stemMode) {

private SnowballStemmer.ALGORITHM algorithmFor(Language language) {
return switch (language) {
case ARABIC -> SnowballStemmer.ALGORITHM.ARABIC;
case CATALAN -> SnowballStemmer.ALGORITHM.CATALAN;
case DANISH -> SnowballStemmer.ALGORITHM.DANISH;
case DUTCH -> SnowballStemmer.ALGORITHM.DUTCH;
case ENGLISH -> SnowballStemmer.ALGORITHM.ENGLISH;
case FINNISH -> SnowballStemmer.ALGORITHM.FINNISH;
case FRENCH -> SnowballStemmer.ALGORITHM.FRENCH;
case GERMAN -> SnowballStemmer.ALGORITHM.GERMAN;
case GREEK -> SnowballStemmer.ALGORITHM.GREEK;
case HUNGARIAN -> SnowballStemmer.ALGORITHM.HUNGARIAN;
case INDONESIAN -> SnowballStemmer.ALGORITHM.INDONESIAN;
case IRISH -> SnowballStemmer.ALGORITHM.IRISH;
case ITALIAN -> SnowballStemmer.ALGORITHM.ITALIAN;
case NORWEGIAN_BOKMAL -> SnowballStemmer.ALGORITHM.NORWEGIAN;
Expand All @@ -159,7 +164,6 @@ private SnowballStemmer.ALGORITHM algorithmFor(Language language) {
case SPANISH -> SnowballStemmer.ALGORITHM.SPANISH;
case SWEDISH -> SnowballStemmer.ALGORITHM.SWEDISH;
case TURKISH -> SnowballStemmer.ALGORITHM.TURKISH;
case ENGLISH -> SnowballStemmer.ALGORITHM.ENGLISH;
default -> null;
};
}
Expand Down

0 comments on commit c48ca65

Please sign in to comment.