[Schmitzm-commits] r1929 - 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
Sun Apr 1 22:22:30 CEST 2012


Author: alfonx
Date: 2012-04-01 22:22:30 +0200 (Sun, 01 Apr 2012)
New Revision: 1929

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
   trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
Log:
Fixes in ib_normStr bzgl. '%xx' und mehr...

Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-03-31 07:44:50 UTC (rev 1928)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-04-01 20:22:30 UTC (rev 1929)
@@ -458,11 +458,19 @@
 
 		strasse = strasse.toLowerCase();
 
+		strasse = strasse.replaceAll("x{2,}$", "");
+		strasse = strasse.replaceAll("\\sx+$", "");
+		
+		strasse = strasse.replaceAll("wegx$", "weg");
+		strasse = strasse.replaceAll("strassex$", "strasse");
+		strasse = strasse.replaceAll("alleex$", "allee");
+		
 		strasse = strasse.replaceAll("str[\\.\\s]", "strasse");
 		strasse = strasse.replaceAll("strase", "strasse");
+		strasse = strasse.replaceAll("ßtrase", "strasse");
 		strasse = strasse.replaceAll("alle\\b", "allee");
 		strasse = strasse.replaceAll("alee\\b", "allee");
-		strasse = strasse.replaceAll("\\s*s$", "strasse");
+		strasse = strasse.replaceAll("\\s+s$", "strasse");
 
 		strasse = strasse.replaceAll("\\bgeschw[\\.\\s-]", "geschwister");
 		strasse = strasse.replaceAll("\\bgebr[\\.\\s-]", "gebrueder");

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-03-31 07:44:50 UTC (rev 1928)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-04-01 20:22:30 UTC (rev 1929)
@@ -310,7 +310,17 @@
 		assertEquals("drvogelerstrasse", AddrStringUtil.normalizeStr("Dr.Vogelerstraße"));
 		assertEquals("drvogelerstrasse", AddrStringUtil.normalizeStr("Dr.Vogelerstrasse"));
 		assertEquals("drvogelerstrasse", AddrStringUtil.normalizeStr("Dr.Vogeler S"));
-		assertEquals("drvogelerstrasse", AddrStringUtil.normalizeStr("Dr.Vogeler Strase"));
+		assertEquals("amschloss", AddrStringUtil.normalizeStr("Am Schloss"));
+		assertEquals("zillerstrasse", AddrStringUtil.normalizeStr("Zillerßtrase"));
+		assertEquals("implerstrasse", AddrStringUtil.normalizeStr("Impler Strasse XX"));
+		assertEquals("implerstrasse", AddrStringUtil.normalizeStr("Impler Strasse xx"));
+		assertEquals("implerstrasse", AddrStringUtil.normalizeStr("Impler Strasse xxx"));
+		assertEquals("aufdemflux", AddrStringUtil.normalizeStr("Auf dem Flux"));
+		assertEquals("aufdemflux", AddrStringUtil.normalizeStr("Auf dem Flux xx"));
+		assertEquals("bergweg", AddrStringUtil.normalizeStr("Bergweg x"));
+		assertEquals("bergweg", AddrStringUtil.normalizeStr("Bergwegx"));
+		assertEquals("bergstrasse", AddrStringUtil.normalizeStr("Bergstrassex"));
+		assertEquals("lindenallee", AddrStringUtil.normalizeStr("lindenalleex"));
 	}
 
 	@Test



More information about the Schmitzm-commits mailing list