[Schmitzm-commits] r2105 - 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
Tue Oct 9 18:40:43 CEST 2012


Author: alfonx
Date: 2012-10-09 18:40:43 +0200 (Tue, 09 Oct 2012)
New Revision: 2105

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
   trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
Log:
kleiner fix beim address split

Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-10-09 09:37:25 UTC (rev 2104)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-10-09 16:40:43 UTC (rev 2105)
@@ -32,7 +32,7 @@
 	final static Pattern REGEX_splitFullString = regexCache
 			.getPattern("^(.*\\d+\\.+[^\\d]*|[^\\d,]+)"
 					+ "\\s*"
-					+ "(\\d+|\\d+\\s*-\\s*\\d+|\\d+\\s*[,\\s*\\d+]+|\\d+\\s*[&]\\s*\\d+|\\d+\\s*bis\\s*\\d+|\\d+\\s*\\\\\\s*\\d+|\\d+\\s*[/\\s*\\d+]+)"
+					+ "(\\d+\\s*-\\s*\\d+|\\d+|\\d+\\s*[,\\s*\\d+]+|\\d+\\s*[&]\\s*\\d+|\\d+\\s*bis\\s*\\d+|\\d+\\s*\\\\\\s*\\d+|\\d+\\s*[/\\s*\\d+]+)"
 					+ "\\s*" + "([^\\d].*[0][\\d]+|[^\\d]*?)" + "\\s*$");
 
 	final static Pattern REGEX_hnZusatzBereich2aBis2f = regexCache

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-10-09 09:37:25 UTC (rev 2104)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-10-09 16:40:43 UTC (rev 2105)
@@ -23,6 +23,9 @@
 
 	@Test
 	public void testGetHausnummernInterpreted() {
+		checkHausnummern("102 - 104", "102", "103", "104");
+		checkHausnummern("102-104", "102", "103", "104");
+
 		checkHausnummern("21300", null);
 
 		checkHausnummern("54a - 58", "54a", "55", "56", "57", "58");
@@ -106,6 +109,10 @@
 
 	@Test
 	public void testSplit() {
+
+		checkSplit("Kocherstrasse", "Kocherstrasse ,  15 - 19", "15 - 19", null, null, null);
+		checkSplit("Kocherstrasse", "Kocherstrasse ,  105 - 109", "105 - 109", null, null, null);
+
 		checkSplit("musterstraße", "musterstraße 23/34", "23/34", null, null, null);
 
 		// TODO
@@ -126,6 +133,11 @@
 		// TODO ja, die gibts.. da es aber keine 16er und keine 18er strasse in D-Land gibt, können wir das auch ruhig
 		// speziell abfangen...
 
+		checkSplit("Kocherstrasse", "Kocherstrasse ,  5 - 9 -", "5 - 9", null, null, null);
+		checkSplit("Kocherstrasse", "Kocherstrasse ,  5 - 9", "5 - 9", null, null, null);
+
+		checkSplit("Kaiserstraße", "Kaiserstraße 102a", "102", null, "a", null);
+
 		checkSplit("Kaiserstraße", "Kaiserstraße 119", "119", null, null, null);
 
 		checkSplit("Straße des 17. Juni", "Straße des 17. Juni 135", "135", null, null, null);
@@ -146,8 +158,6 @@
 
 		checkSplit("Ober-Ramstädter Str.", "Ober-Ramstädter Str .  96 G 1", "96", null, "G 1", null);
 
-		checkSplit("Kocherstrasse", "Kocherstrasse ,  5 - 9 -", "5 - 9", null, null, null);
-
 		checkSplit("H.-Weigel-Str.", "H . -Weigel-Str .  5 b/ 0402 -", "5", null, "b/0402", null);
 
 		checkSplit("Richard Strauss Straße", "Richard Strauss Straße 80 &", "80", null, "&", null);



More information about the Schmitzm-commits mailing list