[Schmitzm-commits] r2185 - 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
Wed Jan 9 15:59:53 CET 2013


Author: alfonx
Date: 2013-01-09 15:59:53 +0100 (Wed, 09 Jan 2013)
New Revision: 2185

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	2012-12-30 18:31:05 UTC (rev 2184)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-01-09 14:59:53 UTC (rev 2185)
@@ -225,7 +225,6 @@
 		zusammen = removeSpacesBetweenHiphenAndDotAndLetters(zusammen);
 
 		Matcher m = REGEX_splitFullString.matcher(zusammen);
-
 		final boolean found = m.find();
 
 		if (!found) {
@@ -682,6 +681,10 @@
 
 		strasse = RegexCache.getInstance().replaceFirst(strasse,
 				"([\\d\\s])(?:(?i)eg|og|vh|hh)\\s*(?:(?i)li|re|links|rechts)$", "$1");
+		
+		strasse = RegexCache.getInstance().replaceAll(strasse, "\\.,", ".");		
+		strasse = RegexCache.getInstance().replaceAll(strasse, "(?i)des 4\\.?\\s*?Julis?", "des 4. Juli");		
+		strasse = RegexCache.getInstance().replaceAll(strasse, "(?i)des 18\\.?\\s*?Oktobers?", "des 18. Oktober");		
 
 		{
 			// Großschreibung aller Anfangsbuchstaben, AUSSER in den Hausnummerzusätzen

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-12-30 18:31:05 UTC (rev 2184)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2013-01-09 14:59:53 UTC (rev 2185)
@@ -117,6 +117,8 @@
 		// TODO
 //		checkSplit("Kocherstrasse", "Kocherstrasse 15 1", "15", null, "1", null);
 		
+//		checkSplit("Kosselstr.2 u 4", "Kosselstr.","2 u 4", null);
+		
 		checkSplit("Burgstr.", "Burgstr.  153A-154   ", "153A-154", null,
 				null, null);
 		
@@ -256,6 +258,9 @@
 //				null, null);
 				
 	}
+	private void checkSplit(String istStrasse, String sollStrasse, String sollHn, String sollZusatz) {
+		checkSplit(sollStrasse, istStrasse, sollHn, null, sollZusatz, null);
+	}
 
 	private void checkSplit(String sollStrasse, String istStrasse, String sollHn, String istHn, String sollZusatz,
 			String istZusatz) {
@@ -463,6 +468,8 @@
 		assertEquals("Bettinastr.", AddrStringUtil.saeubereStrassenname("BETTINASTR."));
 		assertEquals("Franz-Mehring-Str.", AddrStringUtil.saeubereStrassenname("Franz- Mehring- Straße"));
 		assertEquals("Auf dem Glockenberg 30", AddrStringUtil.saeubereStrassenname("Auf Dem Glockenberg 30"));
+		
+		assertEquals("Lloydstr. 13", AddrStringUtil.saeubereStrassenname("Lloydstr., 13"));
 	}
 
 }



More information about the Schmitzm-commits mailing list