[Schmitzm-commits] r2380 - in trunk/schmitzm-adresses/src: main/java/de/schmitzm/adresses test/java/de/schmitzm/adresses
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Thu Aug 1 19:49:36 CEST 2013
Author: alfonx
Date: 2013-08-01 19:49:36 +0200 (Thu, 01 Aug 2013)
New Revision: 2380
Modified:
trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
Log:
Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java 2013-07-29 15:39:38 UTC (rev 2379)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java 2013-08-01 17:49:36 UTC (rev 2380)
@@ -690,9 +690,11 @@
txt = LangUtil.removeWhitespacesToEmpty(txt);
- txt = txt.replaceAll("ü", "ue");
+ txt = txt.replaceAll("(ä|ã€)", "ae");
+
+ txt = txt.replaceAll("(ü|ã¼|ãœ)", "ue");
+
txt = txt.replaceAll("ö", "oe");
- txt = txt.replaceAll("ä", "ae");
txt = txt.replaceAll("ß", "ss");
txt = txt.replaceAll("[éè]", "e");
txt = txt.replaceAll("[áà]", "a");
Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java 2013-07-29 15:39:38 UTC (rev 2379)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java 2013-08-01 17:49:36 UTC (rev 2380)
@@ -117,7 +117,7 @@
// TODO
// checkSplit("Kocherstrasse", "Kocherstrasse 15 1", "15", null, "1", null);
// checkSplit("Auf dem Loh", "Auf dem Loh 77 und 79", "77 und 79", null, null, null);
- // //https://alfonx.ath.cx/immobrain-web/web/iaSuche.xhtml?id=3017601109
+ // iaSuche.xhtml?id=3017601109
// checkSplit("Kosselstr.2 u 4", "Kosselstr.","2 u 4", null);
checkSplit("Kollau Str. 2.reihe 90a", "Kollau Str.", "90", "a");
@@ -370,6 +370,12 @@
@Test
public void testNormalizeStrasse() {
+ // TODO alle Umlaute auch hier!
+ // TODO aus ins SQL übertragen?!
+ assertEquals("kreuzaeckerstrasse", AddrStringUtil.normalizeStr("KreuzÀckerstrasse"));
+ assertEquals("muesserstrasse", AddrStringUtil.normalizeStr("Müsserstrasse"));
+ assertEquals("muesserstrasse", AddrStringUtil.normalizeStr("MÃœsserstrasse"));
+
assertEquals("aufmhennekamp", AddrStringUtil.normalizeStr("Auf´m Hennekamp"));
assertEquals("aufmhennekamp", AddrStringUtil.normalizeStr("Auf'm Hennekamp"));
assertEquals("aufmhennekamp", AddrStringUtil.normalizeStr("Auf`m Hennekamp"));
@@ -513,7 +519,7 @@
assertEquals("Bergstr. 3-9", AddrStringUtil.saeubereStrassenname("Bergstraße 3 - 9"));
assertEquals("78er-Str. 45a-d", AddrStringUtil.saeubereStrassenname("78 er - Straße 45 A - d"));
- // https://alfonx.ath.cx/immobrain-web/web/iaSuche.xhtml?id=3007927506
+ // iaSuche.xhtml?id=3007927506
assertEquals("Ludwigsstädter Str. 95+97", AddrStringUtil.saeubereStrassenname("Ludwigsstädter Str. 95 97"));
assertEquals("Gerstäckerstr. 1", AddrStringUtil.saeubereStrassenname("Gerstäckerstr. 1*"));
More information about the Schmitzm-commits
mailing list