12 |
public String etage = ""; |
public String etage = ""; |
13 |
public String lejlighed = ""; |
public String lejlighed = ""; |
14 |
public String resten = ""; |
public String resten = ""; |
15 |
|
|
16 |
|
@Override |
17 |
|
public String toString() { |
18 |
|
return vej + " / " + husnr + " / " + litra; |
19 |
|
} |
20 |
} |
} |
21 |
|
|
22 |
public static String vaskVejnavn(String indVejnavn) { |
public static String vaskVejnavn(String indVejnavn) { |
30 |
out = out.replace("'", ""); |
out = out.replace("'", ""); |
31 |
out = out.replace(";", ""); |
out = out.replace(";", ""); |
32 |
out = out.replace(":", ""); |
out = out.replace(":", ""); |
33 |
|
out = out.replace("´", ""); |
34 |
|
|
35 |
|
|
36 |
return out; |
return out; |
37 |
} |
} |
72 |
delStreng.append( indAdresse.charAt(i) ); |
delStreng.append( indAdresse.charAt(i) ); |
73 |
i++; |
i++; |
74 |
} |
} |
75 |
result.vej = WordUtils.capitalize( delStreng.toString().trim() ); |
|
76 |
|
|
77 |
|
result.vej = delStreng.toString().toLowerCase().trim(); |
78 |
|
if ( result.vej.endsWith(".") || result.vej.endsWith(",")) { |
79 |
|
result.vej = result.vej.substring(0, result.vej.length() - 1); |
80 |
|
result.vej = result.vej.trim(); |
81 |
|
} |
82 |
|
|
83 |
|
//special case - hvis strengen ender med ' nr' skal ' nr' fjernes |
84 |
|
if ( result.vej.endsWith(" nr")) { |
85 |
|
result.vej = result.vej.substring(0, result.vej.length() - 3); |
86 |
|
} |
87 |
|
|
88 |
|
result.vej = WordUtils.capitalize( result.vej.trim() ); |
89 |
|
|
90 |
|
|
91 |
|
|
130 |
if (i>=len) //THN tilføjelse |
if (i>=len) //THN tilføjelse |
131 |
return result; |
return result; |
132 |
|
|
133 |
if (Character.isAlphabetic(indAdresse.charAt(i) )) { |
if (Character.isAlphabetic(indAdresse.charAt(i) )) { |
134 |
if ( (i+1 == len || |
char current = Character.toUpperCase( indAdresse.charAt(i) ); |
135 |
(Character.isAlphabetic(indAdresse.charAt(i+1)) == false && indAdresse.charAt(i+1) != '.') |
|
136 |
) |
if (current != 'Æ'&& current != 'Ø' && current != 'Å') { |
137 |
) { |
if ( (i+1 == len || |
138 |
result.litra = "" + indAdresse.charAt(i); |
(Character.isAlphabetic(indAdresse.charAt(i+1)) == false |
139 |
result.litra = result.litra.toUpperCase(); |
/*&& indAdresse.charAt(i+1) != '.'*/) |
140 |
i++; |
) |
141 |
|
) { |
142 |
|
result.litra = "" + current; |
143 |
|
i++; |
144 |
|
} |
145 |
} |
} |
146 |
} |
} |
147 |
|
|
148 |
|
// ignorer blanke og komma og punktum |
149 |
|
while (i<len && (indAdresse.charAt(i) == '.' || indAdresse.charAt(i) == ',' || indAdresse.charAt(i) == ' ') ) { |
150 |
|
i++; |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|