From 8fc7e8d304b138f158e269dcae0e9754e7ff7d33 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Tue, 15 May 2018 15:50:59 +0300 Subject: [PATCH] Improved amenity matcher for wiki articles --- .../net/osmand/plus/wikipedia/WikiArticleHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java index e013875ec0..48fc26a90e 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java @@ -129,10 +129,12 @@ public class WikiArticleHelper { ResultMatcher matcher = new ResultMatcher() { @Override public boolean publish(Amenity amenity) { - List otherNames = amenity.getAllNames(false); - String localeName = amenity.getName(lang, false); - if (name.equalsIgnoreCase(localeName) || otherNames.contains(name)) { - results.add(amenity); + List allNames = amenity.getAllNames(false); + for (String amenityName : allNames) { + if (name.equalsIgnoreCase(amenityName)) { + results.add(amenity); + break; + } } return false; }