Skip to content

Commit

Permalink
[de] improve LineExpander.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnesKleinhans committed Jul 24, 2023
1 parent 2b3ffdc commit 6bc8119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ private List<String> handleLineWithFlags(String line) {
if (word.endsWith("straße") || word.endsWith("strasse")) {
result.add(word.replaceAll("stra(ß|ss)e", "str."));
}
if (word.endsWith("Straße") || word.endsWith("Strasse")) {
result.add(word.replaceAll("Stra(ß|ss)e", "Str."));
}
} else if (c == 'A' || c == 'P') { // Adjektiv / Partizip
add(result, word);
if (word.endsWith("e")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public void testExpansion() {
assertThat(expand("Tisch/E #bla #foo"), is("[Tisch, Tische]"));
assertThat(expand("Goethestraße/T"), is("[Goethestraße, Goethestr.]"));
assertThat(expand("Goethestrasse/T"), is("[Goethestrasse, Goethestr.]"));
assertThat(expand("Zwingenberger Stra\u00DFe/T"), is("[Zwingenberger Stra\u00DFe, Zwingenberger Str.]"));
assertThat(expand("Zwingenberger Strasse/T"), is("[Zwingenberger Strasse, Zwingenberger Str.]"));

assertThat(expand("Escape\\/N"), is("[Escape/N]"));
//assertThat(expand("Escape\\/N/S"), is("[Escape/N, Escape/Ns]")); // combination of escape and flag not supported yet
Expand Down

0 comments on commit 6bc8119

Please sign in to comment.