--- android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2011/06/08 19:11:36 1512 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2011/07/09 07:31:01 1569 @@ -145,12 +145,25 @@ return stations; } - public StationBean getByName(final String name) throws SQLException { + private String removeSuffix(String str, String suffix) { + if (str.endsWith(suffix)) { + return str.substring(0, str.length() - suffix.length() ); + } else { + return str; + } + } + + public StationBean getByName(String name) throws SQLException { + name = removeSuffix(name, " st."); + name = removeSuffix(name, " st"); + name = removeSuffix(name, " station"); + StationBean stations = getByNameNormal(name); if (stations.entries.size() == 0) { - logger.info("getByName failover: " + name); stations = getByNameFuzzy(name); + + logger.info("getByName failover: " + name + "(" + (stations.entries.size() >0) + ")" ); } return stations; } @@ -245,7 +258,7 @@ } //used to create full dump in order to populate Google Appengine DB - @Deprecated + //after 1.1.0 also used to populate client-side station list public StationBean dumpAll() throws SQLException { String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " +