Improved amenity matcher for wiki articles

This commit is contained in:
PaulStets 2018-05-15 15:50:59 +03:00
parent 7959a2fb66
commit 8fc7e8d304

View file

@ -129,10 +129,12 @@ public class WikiArticleHelper {
ResultMatcher<Amenity> matcher = new ResultMatcher<Amenity>() {
@Override
public boolean publish(Amenity amenity) {
List<String> otherNames = amenity.getAllNames(false);
String localeName = amenity.getName(lang, false);
if (name.equalsIgnoreCase(localeName) || otherNames.contains(name)) {
results.add(amenity);
List<String> allNames = amenity.getAllNames(false);
for (String amenityName : allNames) {
if (name.equalsIgnoreCase(amenityName)) {
results.add(amenity);
break;
}
}
return false;
}