[Schmitzm-commits] r2307 - 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 28 20:59:03 CEST 2013


Author: alfonx
Date: 2013-04-28 20:59:03 +0200 (Sun, 28 Apr 2013)
New Revision: 2307

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-04-28 00:58:06 UTC (rev 2306)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-04-28 18:59:03 UTC (rev 2307)
@@ -714,9 +714,9 @@
 		 */
 		String strasse = orginal;
 
-//		strasse = strasse.replaceAll("(?i)(\\d[a-z]?)\\s*\\+\\s*(\\d)", "$1HIERSTEHTPLUS$2");
+		// strasse = strasse.replaceAll("(?i)(\\d[a-z]?)\\s*\\+\\s*(\\d)", "$1HIERSTEHTPLUS$2");
 		strasse = RegexUtil.removeTags(strasse).toLowerCase();
-//		strasse = strasse.replaceAll("(?i)HIERSTEHTPLUS", "+");
+		// strasse = strasse.replaceAll("(?i)HIERSTEHTPLUS", "+");
 
 		// * irgendwo
 		strasse = RegexCache.getInstance().replaceAll(strasse, "\\s*?\\*\\s*?", " ");
@@ -787,7 +787,9 @@
 		}
 
 		// Weg- 11
-		strasse = RegexCache.getInstance().replaceAll(strasse, "(?!\\w)\\s*?-\\s*?(?>(?:\\d|\\s))", " ");
+		strasse = RegexCache.getInstance().replaceAll(strasse, "(\\D|\\s)-(\\d|\\s)", "$1$2");
+		// strasse = RegexCache.getInstance().replaceAll(strasse, "(\\D)\\s*-\\s*(\\D)", " ");
+		// strasse = RegexCache.getInstance().replaceAll(strasse, "(?!\\w)\\s*?-\\s*?(?>(?:\\d|\\s))", " ");
 
 		// 10b33 zu 10b 33
 		strasse = RegexCache.getInstance().replaceAll(strasse, "(?i)(\\d[a-z])(\\d)", "$1 $2");

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2013-04-28 00:58:06 UTC (rev 2306)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2013-04-28 18:59:03 UTC (rev 2307)
@@ -315,7 +315,7 @@
 
 	@Test
 	public void testNormalizeOrt() {
-		
+
 		// TODO beim nächsten Update der Funktion mitmachen
 		// assertEquals("weidenxxoberpfalz", AddrStringUtil.normalizeOrt("Weiden , Oberpf"));
 
@@ -505,6 +505,12 @@
 		assertEquals("Europa-Park-Str. 4+6", AddrStringUtil.saeubereStrassenname("Europa-Park-Str. 4+6"));
 		assertEquals("Europa-Park-Str. 4+6", AddrStringUtil.saeubereStrassenname("Europa-Park-Str. 4 + 6"));
 
+		assertEquals("Bergstr. 39-49", AddrStringUtil.saeubereStrassenname(" Bergstraße 39-49 "));
+		assertEquals("Bergstr. 39-49", AddrStringUtil.saeubereStrassenname(" Bergstraße 39 - 49 "));
+		assertEquals("Bergstr. 39-49", AddrStringUtil.saeubereStrassenname("Bergstraße 39 - 49"));
+		assertEquals("Bergstr. 3-9", AddrStringUtil.saeubereStrassenname("Bergstraße 3-9"));
+		assertEquals("Bergstr. 3-9", AddrStringUtil.saeubereStrassenname("Bergstraße 3 - 9"));
+
 	}
 
 }



More information about the Schmitzm-commits mailing list