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