Fix Wiki Indexer
This commit is contained in:
parent
cebff7a0c1
commit
418d427463
1 changed files with 3 additions and 3 deletions
|
@ -274,7 +274,7 @@ public class WikiIndexer {
|
|||
}
|
||||
|
||||
private float zeroParseFloat(String s) {
|
||||
return s.length() == 0 ? 0 : Float.parseFloat(s);
|
||||
return s == null || s.length() == 0 ? 0 : Float.parseFloat(s);
|
||||
}
|
||||
|
||||
private int findOpenBrackets(int i) {
|
||||
|
@ -353,7 +353,7 @@ public class WikiIndexer {
|
|||
String lon_dir = readProperty("lon_dir", h, e);
|
||||
String lat_dg = readProperty("lat_deg", h, e);
|
||||
String lon_dg = readProperty("lon_deg", h, e);
|
||||
if(lat_dg.length() == 0 || lon_dg.length() == 0){
|
||||
if(lon_dg == null || lat_dg == null || lat_dg.length() == 0 || lon_dg.length() == 0){
|
||||
return;
|
||||
}
|
||||
float lat_deg = Float.parseFloat(lat_dg);
|
||||
|
@ -365,7 +365,7 @@ public class WikiIndexer {
|
|||
lat = (("S".equals(lat_dir))? -1 : 1) * (lat_deg + (lat_min + lat_sec/60)/60);
|
||||
lon = (("E".equals(lon_dir))? -1 : 1) * (lon_deg + (lon_min + lon_sec/60)/60);
|
||||
} catch (RuntimeException es) {
|
||||
log.debug("Article " + title, es);
|
||||
log.error("Article " + title, es);
|
||||
return;
|
||||
}
|
||||
// 3. Parse main subcategory name
|
||||
|
|
Loading…
Reference in a new issue