[Schmitzm-commits] r1994 - 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
Sat May 12 00:35:55 CEST 2012


Author: alfonx
Date: 2012-05-12 00:35:54 +0200 (Sat, 12 May 2012)
New Revision: 1994

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
   trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
Log:
AddrStringUtil

Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-05-11 20:25:53 UTC (rev 1993)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-05-11 22:35:54 UTC (rev 1994)
@@ -1,5 +1,7 @@
 package de.schmitzm.adresses;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -541,7 +543,9 @@
 		ort = ort.replaceAll(".\\ban\\b", "xx"); // neu
 		ort = ort.replaceAll(".\\bbei\\b", "xx"); // neu
 		
-		ort = ort.replaceAll(".\\ba[\\.\\s]d[\\.\\s]", "xx"); // neu
+		//ort = ort.replaceAll(".\\ba[\\.\\s]\\s?d[\\.\\s]", "xx"); // neu
+		ort = ort.replaceAll(".\\ba[\\.\\s]\\s?d[\\.\\s]", "xx"); // Bad Neustadt a. d. Saale
+		
 		ort = ort.replaceAll(".\\bi[\\.\\s]", "xx"); // neu
 		ort = ort.replaceAll(".\\ba[\\.\\s]", "xx"); // neu
 		ort = ort.replaceAll(".\\bb[\\.\\s]", "xx"); // neu

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-05-11 20:25:53 UTC (rev 1993)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-05-11 22:35:54 UTC (rev 1994)
@@ -298,6 +298,11 @@
 		assertEquals("marktscheuren", AddrStringUtil.normalizeOrt("Markt Scheuren"));
 		assertEquals("markt", AddrStringUtil.normalizeOrt("Markt"));
 		assertEquals("berbu", AddrStringUtil.normalizeOrt("Berbu Markt"));
+		
+		assertEquals("badneustadtxxsaale", AddrStringUtil.normalizeOrt("Bad Neustadt a.d.Saale"));
+		assertEquals("badneustadtxxsaale", AddrStringUtil.normalizeOrt("Bad Neustadt a. d. Saale"));
+		assertEquals("badneustadtxxsaale", AddrStringUtil.normalizeOrt("Bad Neustadt a.  d.  Saale"));
+		assertEquals("badneustadtxxsaale", AddrStringUtil.normalizeOrt("Bad Neustadt a.  Saale"));
 
 	}
 



More information about the Schmitzm-commits mailing list