/[projects]/dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AddressUtils.java revision 2406 by torben, Fri Feb 27 12:35:29 2015 UTC dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java revision 2561 by torben, Sun May 24 08:49:41 2015 UTC
# Line 32  public class AddressUtils { Line 32  public class AddressUtils {
32                          return 'u';                          return 'u';
33                                                    
34                  case 'ö':                  case 'ö':
35                          return 'o';                          return 'ø';
36                  case 'ô':                  case 'ô':
37                          return 'o';                          return 'o';
38    
39                  case 'ä':                  case 'ä':
40                          return 'a';                          return 'æ';
41                  case 'â':                  case 'â':
42                          return 'a';                          return 'a';
43                                                    
# Line 69  public class AddressUtils { Line 69  public class AddressUtils {
69          }          }
70                    
71          public static String injectIntoBk(String bkrute, String injected) {          public static String injectIntoBk(String bkrute, String injected) {
72                    if (bkrute == null)
73                            return null;
74                    
75                  String parts[] = bkrute.split("/");                  String parts[] = bkrute.split("/");
76                                    
77                  if (parts.length != 4) {                  if (parts.length != 4) {
# Line 97  public class AddressUtils { Line 100  public class AddressUtils {
100                  while (i<len && (indAdresse.charAt(i) == '.' || indAdresse.charAt(i) == ',' || indAdresse.charAt(i) == ' ') ) {                  while (i<len && (indAdresse.charAt(i) == '.' || indAdresse.charAt(i) == ',' || indAdresse.charAt(i) == ' ') ) {
101                          i++;                          i++;
102                  }                  }
103                    
104    
105                    // alle tegn frem til og med første bogstav er også en del af vejnavn
106                    while ((i < len) && Character.isAlphabetic(indAdresse.charAt(i))==false ) {
107                            delStreng.append( indAdresse.charAt(i) );
108                            i++;
109                    }
110    
111    
112                  // alle karakterer indtil det første tal er vejnavn                  // alle karakterer indtil det første tal er vejnavn
# Line 167  public class AddressUtils { Line 177  public class AddressUtils {
177                                                    
178                          if (current != 'Æ'&& current != 'Ø' && current != 'Å') {                          if (current != 'Æ'&& current != 'Ø' && current != 'Å') {
179                                  if ( (i+1 == len ||                                  if ( (i+1 == len ||
180                                                  (Character.isAlphabetic(indAdresse.charAt(i+1)) == false                                                  (Character.isAlphabetic(indAdresse.charAt(i+1) ) == false
181                                                  /*&& indAdresse.charAt(i+1) != '.'*/)                                                  /*&& indAdresse.charAt(i+1) != '.'*/
182                                                    
183                                                    && checkCo(indAdresse,i) == false // Fra sortér C/O
184                                                                    )
185                                                  )                                                  )
186                                          ) {                                          ) {
187                                          result.litra = "" + current;                                          result.litra = "" + current;
# Line 272  public class AddressUtils { Line 285  public class AddressUtils {
285                  return result;                  return result;
286          }          }
287                    
288            public static boolean checkCo(String addr, int pos) {
289                    
290                    if ( StringUtils.substring(addr, pos, pos+3).equalsIgnoreCase("C/O") )
291                            return true;
292                    
293                    return false;
294    
295            }
296            
297  }  }
298    
299    

Legend:
Removed from v.2406  
changed lines
  Added in v.2561

  ViewVC Help
Powered by ViewVC 1.1.20