Do small simplification

This commit is contained in:
Victor Shcherb 2012-01-09 01:36:45 +01:00
parent a92f33aee1
commit 9eb51c84d8
7 changed files with 48 additions and 15 deletions

View file

@ -299,7 +299,7 @@ public class WikiIndexer {
}
} else if (name.equals("text")) {
if(parseText) {
if(id % 100 == 0) {
if(id % 500 == 0) {
log.debug("Article accepted " + cid + " " + title.toString());
}
analyzeTextForGeoInfoNew();
@ -563,7 +563,7 @@ public class WikiIndexer {
private void processDescription(StringBuilder description, int start) {
for (int j = start; j < text.length();) {
if (text.charAt(j) == '=' && text.charAt(j + 1) == '=') {
if (text.charAt(j) == '=' && text.charAt(j + 1) == '=' && j - start > 2048) {
break;
} else if (text.charAt(j) == '\n' && j - start > 2048) {
break;

View file

@ -173,12 +173,16 @@ public class ContextMenuLayer extends OsmandMapLayer {
LatLon latLon = view.getLatLonFromScreenPoint(point.x, point.y);
StringBuilder description = new StringBuilder();
if(!selectedObjects.isEmpty()){
for(Object o : selectedObjects) {
description.append(selectedContextProvider.getObjectDescription(o));
if (!selectedObjects.isEmpty()) {
if (selectedObjects.size() > 1) {
description.append("1. ");
}
description.append(selectedContextProvider.getObjectDescription(0));
for (int i = 1; i < selectedObjects.size(); i++) {
description.append("\n" + (i + 1) + ". ").append(selectedContextProvider.getObjectDescription(selectedObjects.get(i)));
}
LatLon l = selectedContextProvider.getObjectLocation(selectedObjects.get(0));
if(l != null){
if (l != null) {
latLon = l;
}
}

View file

@ -110,9 +110,10 @@ public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer.I
getFavoriteFromPoint(point, favs);
if(!favs.isEmpty()){
StringBuilder res = new StringBuilder();
int i = 0;
for(FavouritePoint fav : favs) {
if(favs.size() > 1) {
res.append("\n");
if (i++ > 0) {
res.append("\n\n");
}
res.append(view.getContext().getString(R.string.favorite) + " : " + fav.getName()); //$NON-NLS-1$
}

View file

@ -225,9 +225,10 @@ public class OsmBugsLayer extends OsmandMapLayer implements ContextMenuLayer.ICo
getBugFromPoint(point, list);
if(!list.isEmpty()){
StringBuilder res = new StringBuilder();
int i = 0;
for(OpenStreetBug o : list) {
if(list.size() > 1) {
res.append("\n");
if (i++ > 0) {
res.append("\n\n");
}
res.append(activity.getString(R.string.osb_bug_name)+ " : " + o.getName()); //$NON-NLS-1$
}

View file

@ -8,6 +8,7 @@ import java.util.List;
import net.osmand.LogUtil;
import net.osmand.OsmAndFormatter;
import net.osmand.data.Amenity;
import net.osmand.data.AmenityType;
import net.osmand.osm.LatLon;
import net.osmand.plus.PoiFilter;
import net.osmand.plus.R;
@ -99,7 +100,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
for (int i = 0; i < MAXIMUM_SHOW_AMENITIES && i < am.size(); i++) {
Amenity n = am.get(i);
if (i > 0) {
res.append("\n ");
res.append("\n\n");
}
String format = OsmAndFormatter.getPoiSimpleFormat(n, view.getContext(), view.getSettings().USE_ENGLISH_NAMES.get());
res.append(" " + format);
@ -109,7 +110,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
if (n.getPhone() != null) {
res.append("\n").append(view.getContext().getString(R.string.phone)).append(" : ").append(n.getPhone()); //$NON-NLS-1$ //$NON-NLS-2$
}
if (n.getSite() != null) {
if (n.getSite() != null && n.getType() != AmenityType.OSMWIKI) {
res.append("\n").append(view.getContext().getString(R.string.website)).append(" : ").append(n.getSite()); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -72,9 +72,10 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
getFromPoint(point, stops);
if(stops.isEmpty()){
StringBuilder res = new StringBuilder();
int i = 0;
for (TransportStop n : stops) {
if(stops.size() > 1) {
res.append("\n");
if (i++ > 0) {
res.append("\n\n");
}
res.append(getStopDescription(n, true));
}

View file

@ -7,7 +7,7 @@ function download_coord {
gunzip -c "$1"wiki.sql.gz | mysql wiki;
}
cd src_sql;
cd ~/wiki/src_sql;
download_coord en;
download_coord de;
download_coord nl;
@ -30,4 +30,29 @@ download_coord sr;
download_coord eo;
download_coord ro;
download_coord lt;
download_coord fa;
download_coord cs;
download_coord ms;
download_coord zh;
download_coord id;
download_coord fi;
download_coord bg;
download_coord et;
download_coord hr;
download_coord sk;
download_coord nn;
download_coord ko;
download_coord sl;
download_coord el;
download_coord he;
download_coord ar;
download_coord tr;
download_coord th;
download_coord be;
download_coord ka;
download_coord mk;
download_coord lv;
download_coord lb;
download_coord os;
download_coord gl;