From f40657ebec9ba7d643cec67c95be047a37258fad Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 1 Jun 2020 13:54:03 +0200 Subject: [PATCH 01/26] Initial commit address search refactoring --- .../net/osmand/CollatorStringMatcher.java | 46 +- .../java/net/osmand/binary/CommonWords.java | 14 +- .../java/net/osmand/search/SearchUICore.java | 20 +- .../osmand/search/core/SearchCoreFactory.java | 436 ++++++++---------- .../net/osmand/search/core/SearchPhrase.java | 417 +++++++++-------- .../net/osmand/search/core/SearchResult.java | 46 +- .../net/osmand/search/LocationSearchTest.java | 2 +- .../search/SearchUICoreGenericTest.java | 7 +- .../net/osmand/search/SearchUICoreTest.java | 2 +- .../search/QuickSearchDialogFragment.java | 16 +- .../osmand/plus/search/QuickSearchHelper.java | 4 +- .../search/QuickSearchDialogFragment.java | 7 - 12 files changed, 514 insertions(+), 503 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java b/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java index 693be4bd82..f44ea9855d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java +++ b/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java @@ -17,12 +17,20 @@ public class CollatorStringMatcher implements StringMatcher { private final String part; public static enum StringMatcherMode { + // tests only first word as base starts with part CHECK_ONLY_STARTS_WITH, + // tests all words (split by space) and one of word should start with a given part CHECK_STARTS_FROM_SPACE, + // tests all words except first (split by space) and one of word should start with a given part CHECK_STARTS_FROM_SPACE_NOT_BEGINNING, + // tests all words (split by space) and one of word should be equal to part CHECK_EQUALS_FROM_SPACE, + // TO DO: make a separate method + // trims part to make shorter then full text and tests only first word as base starts with part + TRIM_AND_CHECK_ONLY_STARTS_WITH, + // simple collator contains in any part of the base CHECK_CONTAINS, - CHECK_ONLY_STARTS_WITH_TRIM, + // simple collator equals CHECK_EQUALS, } @@ -42,22 +50,25 @@ public class CollatorStringMatcher implements StringMatcher { } - public static boolean cmatches(Collator collator, String base, String part, StringMatcherMode mode){ + public static boolean cmatches(Collator collator, String fullName, String part, StringMatcherMode mode){ switch (mode) { case CHECK_CONTAINS: - return ccontains(collator, base, part); + return ccontains(collator, fullName, part); case CHECK_EQUALS_FROM_SPACE: - return cstartsWith(collator, base, part, true, true, true, false); + return cstartsWith(collator, fullName, part, true, true, true); case CHECK_STARTS_FROM_SPACE: - return cstartsWith(collator, base, part, true, true, false, false); + return cstartsWith(collator, fullName, part, true, true, false); case CHECK_STARTS_FROM_SPACE_NOT_BEGINNING: - return cstartsWith(collator, base, part, false, true, false, false); + return cstartsWith(collator, fullName, part, false, true, false); case CHECK_ONLY_STARTS_WITH: - return cstartsWith(collator, base, part, true, false, false, false); - case CHECK_ONLY_STARTS_WITH_TRIM: - return cstartsWith(collator, base, part, true, false, false, true); + return cstartsWith(collator, fullName, part, true, false, false); + case TRIM_AND_CHECK_ONLY_STARTS_WITH: + if (part.length() > fullName.length()) { + part = part.substring(0, fullName.length()); + } + return cstartsWith(collator, fullName, part, true, false, false); case CHECK_EQUALS: - return cstartsWith(collator, base, part, false, false, true, false); + return cstartsWith(collator, fullName, part, false, false, true); } return false; } @@ -116,21 +127,14 @@ public class CollatorStringMatcher implements StringMatcher { * Special check try to find as well in the middle of name * * @param collator - * @param searchInParam + * @param fullText * @param theStart - * @param trim - trim theStart to searchInParam length if searchInParam non empty * @return true if searchIn starts with token */ - public static boolean cstartsWith(Collator collator, String searchInParam, String theStart, - boolean checkBeginning, boolean checkSpaces, boolean equals, boolean trim) { - String searchIn = searchInParam.toLowerCase(Locale.getDefault()); - if (trim && searchIn.length() > 0) { - searchIn += " "; - } + public static boolean cstartsWith(Collator collator, String fullText, String theStart, + boolean checkBeginning, boolean checkSpaces, boolean equals) { + String searchIn = fullText.toLowerCase(Locale.getDefault()); int searchInLength = searchIn.length(); - if (trim && searchInLength > 0 && theStart.length() > searchInLength) { - theStart = theStart.substring(0, searchInLength); - } int startLength = theStart.length(); if (startLength == 0) { return true; diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/CommonWords.java b/OsmAnd-java/src/main/java/net/osmand/binary/CommonWords.java index 55d7461573..29faf90874 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/CommonWords.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/CommonWords.java @@ -13,10 +13,6 @@ public class CommonWords { frequentlyUsedWordsDictionary.put(string, frequentlyUsedWordsDictionary.size()); } public static int getCommon(String name) { -// if(true) { -// // not ready for old versions yet -// return -1; -// } Integer i = commonWordsDictionary.get(name); return i == null ? -1 : i.intValue(); } @@ -28,7 +24,15 @@ public class CommonWords { public static int getCommonSearch(String name) { Integer i = commonWordsDictionary.get(name); - return i == null ? getFrequentlyUsed(name) : i.intValue() + frequentlyUsedWordsDictionary.size(); + // higher means better for search + if (i == null) { + int fq = getFrequentlyUsed(name); + if (fq != -1) { + return commonWordsDictionary.size() + fq; + } + return -1; + } + return i.intValue(); } public static int getCommonGeocoding(String name) { diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index b49ec81d94..5e7ed1d9d7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -1,7 +1,6 @@ package net.osmand.search; import net.osmand.Collator; -import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapIndexReader; @@ -72,7 +71,7 @@ public class SearchUICore { taskQueue = new LinkedBlockingQueue(); searchSettings = new SearchSettings(new ArrayList()); searchSettings = searchSettings.setLang(locale, transliterate); - phrase = new SearchPhrase(searchSettings, OsmAndCollator.primaryCollator()); + phrase = SearchPhrase.emptyPhrase(); currentSearchResult = new SearchResultCollection(phrase); singleThreadedExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, taskQueue); } @@ -351,10 +350,10 @@ public class SearchUICore { } } - public void setFilterOrders(List filterOrders) { + public void setActivePoiFiltersByOrder(List filterOrders) { for (SearchCoreAPI capi : apis) { if (capi instanceof SearchAmenityTypesAPI) { - ((SearchAmenityTypesAPI) capi).setFilterOrders(filterOrders); + ((SearchAmenityTypesAPI) capi).setActivePoiFiltersByOrder(filterOrders); } } } @@ -404,7 +403,7 @@ public class SearchUICore { } private boolean filterOneResult(SearchResult object, SearchPhrase phrase) { - NameStringMatcher nameStringMatcher = phrase.getNameStringMatcher(); + NameStringMatcher nameStringMatcher = phrase.getFirstUnknownNameStringMatcher(); return nameStringMatcher.matches(object.localeName) || nameStringMatcher.matches(object.otherNames); } @@ -714,16 +713,17 @@ public class SearchUICore { @Override public boolean publish(SearchResult object) { - if (phrase != null && object.otherNames != null && !phrase.getNameStringMatcher().matches(object.localeName)) { + // TODO first , other? + if (phrase != null && object.otherNames != null && !phrase.getFirstUnknownNameStringMatcher().matches(object.localeName)) { for (String s : object.otherNames) { - if (phrase.getNameStringMatcher().matches(s)) { + if (phrase.getFirstUnknownNameStringMatcher().matches(s)) { object.alternateName = s; break; } } if (Algorithms.isEmpty(object.alternateName) && object.object instanceof Amenity) { for (String value : ((Amenity) object.object).getAdditionalInfo().values()) { - if (phrase.getNameStringMatcher().matches(value)) { + if (phrase.getFirstUnknownNameStringMatcher().matches(value)) { object.alternateName = value; break; } @@ -815,7 +815,7 @@ public class SearchUICore { SearchExportSettings exportSettings = phrase.getSettings().getExportSettings(); json.put("settings", phrase.getSettings().toJSON()); - json.put("phrase", phrase.getRawUnknownSearchPhrase()); + json.put("phrase", phrase.getFullSearchPhrase()); if (searchResult.searchResults != null && searchResult.searchResults.size() > 0) { JSONArray resultsArr = new JSONArray(); for (SearchResult r : searchResult.searchResults) { @@ -963,14 +963,12 @@ public class SearchUICore { } public static class SearchResultComparator implements Comparator { - private SearchPhrase sp; private Collator collator; private LatLon loc; private boolean sortByName; public SearchResultComparator(SearchPhrase sp) { - this.sp = sp; this.collator = sp.getCollator(); loc = sp.getLastTokenLocation(); sortByName = sp.isSortByName(); diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index 0d01c98391..d88578c6ed 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -140,20 +140,18 @@ public class SearchCoreFactory { return 0; } - protected void subSearchApiOrPublish(SearchPhrase phrase, - SearchResultMatcher resultMatcher, SearchResult res, SearchBaseAPI api) + protected void subSearchApiOrPublish(SearchPhrase phrase, SearchResultMatcher resultMatcher, SearchResult res, SearchBaseAPI api) throws IOException { - phrase.countUnknownWordsMatch(res); -// int cnt = resultMatcher.getCount(); + phrase.countUnknownWordsMatchMainResult(res); + // TODO select word & delete found words List ws = phrase.getUnknownSearchWords(res.otherWordsMatch); if (!res.firstUnknownWordMatches) { - ws.add(phrase.getUnknownSearchWord()); + ws.add(phrase.getFirstUnknownSearchWord()); } // publish result to set parentSearchResult before search resultMatcher.publish(res); if (!ws.isEmpty() && api != null && api.isSearchAvailable(phrase)) { - SearchPhrase nphrase = phrase.selectWord(res, ws, - phrase.isLastUnknownSearchWordComplete()); + SearchPhrase nphrase = phrase.selectWord(res, ws, phrase.isLastUnknownSearchWordComplete()); resultMatcher.setParentSearchResult(res); api.search(nphrase, resultMatcher); resultMatcher.setParentSearchResult(res.parentSearchResult); @@ -166,8 +164,6 @@ public class SearchCoreFactory { } } - - public static class SearchRegionByNameAPI extends SearchBaseAPI { public SearchRegionByNameAPI() { @@ -186,9 +182,9 @@ public class SearchCoreFactory { sr.objectType = ObjectType.REGION; sr.location = bmir.getRegionCenter(); sr.preferredZoom = 6; - if (phrase.getUnknownSearchWordLength() <= 1 && phrase.isNoSelectedType()) { + if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) { resultMatcher.publish(sr); - } else if (phrase.getNameStringMatcher().matches(sr.localeName)) { + } else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) { resultMatcher.publish(sr); } } @@ -210,19 +206,6 @@ public class SearchCoreFactory { } } - private static String stripBraces(String localeName) { - int i = localeName.indexOf('('); - String retName = localeName; - if (i > -1) { - retName = localeName.substring(0, i); - int j = localeName.indexOf(')', i); - if (j > -1) { - retName = retName.trim() + ' ' + localeName.substring(j); - } - } - return retName; - } - public static class SearchAddressByNameAPI extends SearchBaseAPI { private static final int DEFAULT_ADDRESS_BBOX_RADIUS = 100 * 1000; @@ -310,10 +293,7 @@ public class SearchCoreFactory { if (phrase.isNoSelectedType() && bbox != null && (phrase.isUnknownSearchWordPresent() || phrase.isEmptyQueryAllowed()) && phrase.isSearchTypeAllowed(ObjectType.CITY)) { - String word = phrase.getUnknownWordToSearch(); - NameStringMatcher nm = phrase.getNameStringMatcher(word, phrase.isUnknownSearchWordComplete()); - NameStringMatcher wordEqualsMatcher = phrase.getNameStringMatcher(word, true); - boolean firstUnknownWordMatches = word.equals(phrase.getUnknownSearchWord()); + NameStringMatcher nm = phrase.getMainUnknownNameStringMatcher(); resArray.clear(); resArray = townCitiesQR.queryInBox(bbox, resArray); int limit = 0; @@ -335,8 +315,6 @@ public class SearchCoreFactory { if (phrase.isEmptyQueryAllowed() && phrase.isEmpty()) { resultMatcher.publish(res); } else if (nm.matches(res.localeName) || nm.matches(res.otherNames)) { - res.firstUnknownWordMatches = firstUnknownWordMatches; - res.unknownPhraseMatches = wordEqualsMatcher.matches(res.localeName); subSearchApiOrPublish(phrase, resultMatcher, res, cityApi); } if (limit++ > LIMIT * phrase.getRadiusLevel()) { @@ -348,7 +326,8 @@ public class SearchCoreFactory { private void searchByName(final SearchPhrase phrase, final SearchResultMatcher resultMatcher) throws IOException { - if (phrase.getRadiusLevel() > 1 || phrase.getUnknownSearchWordLength() > 3 || phrase.getUnknownSearchWords().size() > 0 || phrase.isSearchTypeAllowed(ObjectType.POSTCODE, true)) { + if (phrase.getRadiusLevel() > 1 || phrase.getUnknownWordToSearch().length() > 3 || + phrase.hasMoreThanOneUnknownSearchWord()|| phrase.isSearchTypeAllowed(ObjectType.POSTCODE, true)) { final boolean locSpecified = phrase.getLastTokenLocation() != null; LatLon loc = phrase.getLastTokenLocation(); final List immediateResults = new ArrayList<>(); @@ -391,7 +370,7 @@ public class SearchCoreFactory { if (object.getName().startsWith("<")) { return false; } - if (!phrase.getNameStringMatcher().matches(stripBraces(sr.localeName))) { + if (!phrase.getFirstUnknownNameStringMatcher().matches(stripBraces(sr.localeName))) { sr.priorityDistance = 5; } sr.objectType = ObjectType.STREET; @@ -460,16 +439,13 @@ public class SearchCoreFactory { }; Iterator offlineIterator = phrase.getRadiusOfflineIndexes(DEFAULT_ADDRESS_BBOX_RADIUS * 5, SearchPhraseDataType.ADDRESS); - String wordToSearch = phrase.getUnknownWordToSearch(); - NameStringMatcher wordEqualsMatcher = phrase.getNameStringMatcher(wordToSearch, true); - boolean firstUnknownWordMatches = wordToSearch.equals(phrase.getUnknownSearchWord()); while (offlineIterator.hasNext() && wordToSearch.length() > 0) { BinaryMapIndexReader r = offlineIterator.next(); currentFile[0] = r; immediateResults.clear(); SearchRequest req = BinaryMapIndexReader.buildAddressByNameRequest(rm, wordToSearch.toLowerCase(), - phrase.isUnknownSearchWordComplete() ? StringMatcherMode.CHECK_EQUALS_FROM_SPACE + phrase.isMainUnknownSearchWordComplete() ? StringMatcherMode.CHECK_EQUALS_FROM_SPACE : StringMatcherMode.CHECK_STARTS_FROM_SPACE); if (locSpecified) { req.setBBoxRadius(loc.getLatitude(), loc.getLongitude(), @@ -477,8 +453,6 @@ public class SearchCoreFactory { } r.searchAddressDataByName(req); for (SearchResult res : immediateResults) { - res.firstUnknownWordMatches = firstUnknownWordMatches; - res.unknownPhraseMatches = wordEqualsMatcher.matches(res.localeName); if (res.objectType == ObjectType.STREET) { City ct = ((Street) res.object).getCity(); phrase.countUnknownWordsMatch(res, @@ -510,35 +484,34 @@ public class SearchCoreFactory { if (!phrase.isUnknownSearchWordPresent()) { return false; } - boolean hasUnselectedType = phrase.isNoSelectedType() && phrase.isUnknownSearchWordPresent() - && phrase.isUnknownSearchWordComplete() && phrase.hasUnknownSearchWordPoiTypes(); + // TODO + // consider 'bar' - 'Hospital 512' + if (!phrase.isNoSelectedType()) { + // don't search by name when type is selected or poi type is part of name + return false; + } + // boolean hasUnselectedType = phrase.isNoSelectedType() && phrase.isUnknownSearchWordPresent() + // && phrase.isMainUnknownSearchWordComplete() && phrase.hasUnknownSearchWordPoiTypes(); + // Check feedback before it was searching exact match of whole phrase.getUnknownSearchPhrase() + final BinaryMapIndexReader[] currentFile = new BinaryMapIndexReader[1]; Iterator offlineIterator = phrase.getRadiusOfflineIndexes(BBOX_RADIUS, SearchPhraseDataType.POI); - String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); - String searchWord = hasUnselectedType ? unknownSearchPhrase : phrase.getUnknownWordToSearch(); - final NameStringMatcher nm = phrase.getNameStringMatcher(searchWord, phrase.isUnknownSearchWordComplete()); - final NameStringMatcher phraseMatcher; - if (!Algorithms.isEmpty(unknownSearchPhrase)) { - phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS); - } else { - phraseMatcher = null; - } + String searchWord = phrase.getUnknownWordToSearch(); + final NameStringMatcher nm = phrase.getMainUnknownNameStringMatcher(); QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS_INSIDE); final Set ids = new HashSet(); - SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest( - (int)bbox.centerX(), (int)bbox.centerY(), - searchWord, - (int)bbox.left, (int)bbox.right, - (int)bbox.top, (int)bbox.bottom, - new ResultMatcher() { + SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest((int) bbox.centerX(), + (int) bbox.centerY(), searchWord, (int) bbox.left, (int) bbox.right, (int) bbox.top, + (int) bbox.bottom, new ResultMatcher() { int limit = 0; + @Override public boolean publish(Amenity object) { if (phrase.getSettings().isExportObjects()) { resultMatcher.exportObject(object); } - if (limit ++ > LIMIT) { + if (limit++ > LIMIT) { return false; } String poiID = object.getType().getKeyName() + "_" + object.getId(); @@ -547,19 +520,17 @@ public class SearchCoreFactory { } SearchResult sr = new SearchResult(phrase); sr.otherNames = object.getAllNames(true); - sr.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); - if (phrase.isUnknownSearchWordComplete()) { - if(!nm.matches(sr.localeName) && !nm.matches(sr.otherNames) && - !nm.matches(object.getAdditionalInfo().values())) { - return false; - } + sr.localeName = object.getName(phrase.getSettings().getLang(), + phrase.getSettings().isTransliterate()); + if (!nm.matches(sr.localeName) && !nm.matches(sr.otherNames) + && !nm.matches(object.getAdditionalInfo().values())) { + return false; } sr.object = object; sr.preferredZoom = 17; sr.file = currentFile[0]; sr.location = object.getLocation(); - if (object.getSubType().equals("city") || - object.getSubType().equals("country")) { + if (object.getSubType().equals("city") || object.getSubType().equals("country")) { sr.priorityDistance = SEARCH_AMENITY_BY_NAME_CITY_PRIORITY_DISTANCE; sr.preferredZoom = object.getSubType().equals("country") ? 7 : 13; } else if (object.getSubType().equals("town")) { @@ -568,10 +539,7 @@ public class SearchCoreFactory { sr.priorityDistance = 1; } sr.priority = SEARCH_AMENITY_BY_NAME_PRIORITY; - if (phraseMatcher != null) { - sr.unknownPhraseMatches = phraseMatcher.matches(sr.localeName); - } - phrase.countUnknownWordsMatch(sr); + phrase.countUnknownWordsMatchMainResult(sr); sr.objectType = ObjectType.POI; resultMatcher.publish(sr); ids.add(poiID); @@ -580,7 +548,7 @@ public class SearchCoreFactory { @Override public boolean isCancelled() { - return resultMatcher.isCancelled() && (limit < LIMIT) ; + return resultMatcher.isCancelled() && (limit < LIMIT); } }); @@ -633,9 +601,8 @@ public class SearchCoreFactory { private List topVisibleFilters; private List categories; private List customPoiFilters = new ArrayList<>(); - private TIntArrayList customPoiFiltersPriorites = new TIntArrayList(); + private Map activePoiFilters = new HashMap<>(); private MapPoiTypes types; - private List filterOrders = new ArrayList<>(); public SearchAmenityTypesAPI(MapPoiTypes types) { super(ObjectType.POI_TYPE); @@ -644,126 +611,123 @@ public class SearchCoreFactory { public void clearCustomFilters() { this.customPoiFilters.clear(); - this.customPoiFiltersPriorites.clear(); } public void addCustomFilter(CustomSearchPoiFilter poiFilter, int priority) { this.customPoiFilters.add(poiFilter); - this.customPoiFiltersPriorites.add(priority); - } - - public void setFilterOrders(List filterOrders) { - this.filterOrders = filterOrders; - } - - @Override - public boolean search(SearchPhrase phrase, SearchResultMatcher resultMatcher) throws IOException { - if (translatedNames.isEmpty()) { - translatedNames = types.getAllTranslatedNames(false); - topVisibleFilters = types.getTopVisibleFilters(); - categories = types.getCategories(false); + if (priority > 0) { + this.activePoiFilters.put(poiFilter.getFilterId(), priority); } + } + + public void setActivePoiFiltersByOrder(List filterOrder) { + for (int i = 0; i < filterOrder.size(); i++) { + this.activePoiFilters.put(filterOrder.get(i), i); + } + } + + public List getPoiTypeResults(NameStringMatcher nm, boolean includeAdditionals) { List results = new ArrayList(); - List searchWordTypes = new ArrayList(); - NameStringMatcher nm; - String unknownSearchPhrase = phrase.getUnknownSearchPhrase(); - boolean showTopFiltersOnly = !phrase.isUnknownSearchWordPresent(); - if (phrase.getUnknownSearchWord().length() < unknownSearchPhrase.length()) { - nm = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_ONLY_STARTS_WITH_TRIM); - } else { - nm = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_STARTS_FROM_SPACE); - } for (AbstractPoiType pf : topVisibleFilters) { - if (showTopFiltersOnly - || nm.matches(pf.getTranslation()) - || nm.matches(pf.getEnTranslation()) + if (nm.matches(pf.getTranslation()) || nm.matches(pf.getEnTranslation()) || nm.matches(pf.getSynonyms())) { results.add(pf); - searchWordTypes.add(pf); } } - if (!showTopFiltersOnly) { - for (PoiCategory c : categories) { - if (!results.contains(c) - && (nm.matches(c.getTranslation()) - || nm.matches(c.getEnTranslation()) - || nm.matches(c.getSynonyms()))) { - results.add(c); - searchWordTypes.add(c); - } + for (PoiCategory c : categories) { + if (!results.contains(c) && (nm.matches(c.getTranslation()) || nm.matches(c.getEnTranslation()) + || nm.matches(c.getSynonyms()))) { + results.add(c); } - Iterator> it = translatedNames.entrySet().iterator(); - while (it.hasNext()) { - Entry e = it.next(); - PoiType pt = e.getValue(); - if (pt.getCategory() != types.getOtherMapCategory()) { - if (!results.contains(pt) - && (nm.matches(pt.getEnTranslation()) - || nm.matches(pt.getTranslation()) - || nm.matches(pt.getSynonyms()))) { - results.add(pt); - searchWordTypes.add(pt); - } - List additionals = pt.getPoiAdditionals(); - if (additionals != null) { - for (PoiType a : additionals) { - if (!results.contains(a)) { - String enTranslation = a.getEnTranslation().toLowerCase(); - if (!"yes".equals(enTranslation) && !"no".equals(enTranslation) - && (nm.matches(enTranslation) || nm.matches(a.getTranslation()) || nm.matches(a.getSynonyms()))) { - results.add(a); - } + } + Iterator> it = translatedNames.entrySet().iterator(); + while (it.hasNext()) { + Entry e = it.next(); + PoiType pt = e.getValue(); + if (pt.getCategory() != types.getOtherMapCategory()) { + if (!results.contains(pt) && (nm.matches(pt.getEnTranslation()) || nm.matches(pt.getTranslation()) + || nm.matches(pt.getSynonyms()))) { + results.add(pt); + } + List additionals = pt.getPoiAdditionals(); + if (additionals != null && includeAdditionals) { + for (PoiType a : additionals) { + if (!results.contains(a)) { + String enTranslation = a.getEnTranslation().toLowerCase(); + if (!"yes".equals(enTranslation) && !"no".equals(enTranslation) + && (nm.matches(enTranslation) || nm.matches(a.getTranslation()) + || nm.matches(a.getSynonyms()))) { + results.add(a); } } } } } } - phrase.setUnknownSearchWordPoiTypes(searchWordTypes); + return results; + } - if (resultMatcher != null) { - String word = phrase.getUnknownSearchWord(); - NameStringMatcher startMatch = new NameStringMatcher(word, StringMatcherMode.CHECK_ONLY_STARTS_WITH); - for (AbstractPoiType pt : results) { + private void initPoiTypes() { + if (translatedNames.isEmpty()) { + translatedNames = types.getAllTranslatedNames(false); + topVisibleFilters = types.getTopVisibleFilters(); + categories = types.getCategories(false); + } + } + + @Override + public boolean search(SearchPhrase phrase, SearchResultMatcher resultMatcher) throws IOException { + boolean showTopFiltersOnly = !phrase.isUnknownSearchWordPresent(); + NameStringMatcher nm = phrase.getFullUnknownNameMatcher(); + initPoiTypes(); + List poiTypes = topVisibleFilters; + if (!showTopFiltersOnly) { + poiTypes = getPoiTypeResults(nm, true); + } + for (AbstractPoiType pt : poiTypes) { + SearchResult res = new SearchResult(phrase); + res.localeName = pt.getTranslation(); + res.object = pt; + addPoiTypeResult(phrase, resultMatcher, showTopFiltersOnly, getStandardFilterId(pt), res); + } + for (int i = 0; i < customPoiFilters.size(); i++) { + CustomSearchPoiFilter csf = customPoiFilters.get(i); + if (showTopFiltersOnly || nm.matches(csf.getName())) { SearchResult res = new SearchResult(phrase); - res.localeName = pt.getTranslation(); - res.object = pt; - res.priorityDistance = 0; - res.objectType = ObjectType.POI_TYPE; - res.firstUnknownWordMatches = startMatch.matches(res.localeName); - if (showTopFiltersOnly) { - String stdFilterId = getStandardFilterId(pt); - if (filterOrders.contains(stdFilterId)) { - res.priority = SEARCH_AMENITY_TYPE_PRIORITY + filterOrders.indexOf(stdFilterId); - resultMatcher.publish(res); - } - } else { - res.priority = SEARCH_AMENITY_TYPE_PRIORITY; - resultMatcher.publish(res); - } - } - for (int i = 0; i < customPoiFilters.size(); i++) { - CustomSearchPoiFilter csf = customPoiFilters.get(i); - if (!phrase.isUnknownSearchWordPresent() || nm.matches(csf.getName())) { - SearchResult res = new SearchResult(phrase); - res.localeName = csf.getName(); - res.object = csf; - res.objectType = ObjectType.POI_TYPE; - if (showTopFiltersOnly) { - if (filterOrders.contains(csf.getFilterId())) { - res.priority = SEARCH_AMENITY_TYPE_PRIORITY + filterOrders.indexOf(csf.getFilterId()); - resultMatcher.publish(res); - } - } else { - res.priority = SEARCH_AMENITY_TYPE_PRIORITY + customPoiFiltersPriorites.get(i); - resultMatcher.publish(res); - } - } + res.localeName = csf.getName(); + res.object = csf; + addPoiTypeResult(phrase, resultMatcher, showTopFiltersOnly, csf.getFilterId(), res); } } return true; } + private void addPoiTypeResult(SearchPhrase phrase, SearchResultMatcher resultMatcher, boolean showTopFiltersOnly, + String stdFilterId , SearchResult res) { + res.priorityDistance = 0; + res.objectType = ObjectType.POI_TYPE; + if (showTopFiltersOnly) { + if (activePoiFilters.containsKey(stdFilterId)) { + res.priority = getPoiTypePriority(stdFilterId); + resultMatcher.publish(res); + } + } else { + phrase.countUnknownWordsMatchMainResult(res); + res.priority = SEARCH_AMENITY_TYPE_PRIORITY; + resultMatcher.publish(res); + } + } + + private int getPoiTypePriority(String stdFilterId) { + Integer i = activePoiFilters.get(stdFilterId); + if ( i == null) { + return SEARCH_AMENITY_TYPE_PRIORITY; + } + return SEARCH_AMENITY_TYPE_PRIORITY + i.intValue(); + } + + + public String getStandardFilterId(AbstractPoiType poi) { return STD_POI_FILTER_PREFIX + poi.getKeyName(); } @@ -842,68 +806,67 @@ public class SearchCoreFactory { @Override public boolean search(final SearchPhrase phrase, final SearchResultMatcher resultMatcher) throws IOException { + SearchPoiTypeFilter poiTypeFilter = null; + String nameFilter = null; if (phrase.isLastWord(ObjectType.POI_TYPE)) { Object obj = phrase.getLastSelectedWord().getResult().object; - SearchPoiTypeFilter ptf; if (obj instanceof AbstractPoiType) { - ptf = getPoiTypeFilter((AbstractPoiType) obj); + poiTypeFilter = getPoiTypeFilter((AbstractPoiType) obj); } else if (obj instanceof SearchPoiTypeFilter) { - ptf = (SearchPoiTypeFilter) obj; + poiTypeFilter = (SearchPoiTypeFilter) obj; } else { throw new UnsupportedOperationException(); } - searchPoi(phrase, resultMatcher, obj, null, ptf); } else if (searchAmenityTypesAPI != null) { - if (phrase.getUnknownSearchWordPoiTypes() == null) { - searchAmenityTypesAPI.search(phrase, null); - } + NameStringMatcher nm = phrase.getFullUnknownNameMatcher(); + searchAmenityTypesAPI.initPoiTypes(); + List presentPoiTypes = searchAmenityTypesAPI.getPoiTypeResults(nm, false); + // TODO get first ? AbstractPoiType poiType = phrase.getUnknownSearchWordPoiType(); if (poiType != null) { - SearchPoiTypeFilter ptf = getPoiTypeFilter(poiType); - String customName = phrase.getPoiNameFilter(poiType); - if (customName != null) { + poiTypeFilter = getPoiTypeFilter(poiType); + nameFilter = phrase.getPoiNameFilter(poiType); + if (nameFilter != null) { phrase.setUnknownSearchWordPoiType(poiType); - searchPoi(phrase, resultMatcher, null, customName.length() == 0 ? null : customName, ptf); } } } + if (poiTypeFilter != null) { + QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); + List offlineIndexes = phrase.getOfflineIndexes(); + Set searchedPois = new TreeSet<>(); + for (BinaryMapIndexReader r : offlineIndexes) { + ResultMatcher rm = getResultMatcher(phrase, resultMatcher, nameFilter, r, searchedPois); + if (poiTypeFilter instanceof CustomSearchPoiFilter) { + rm = ((CustomSearchPoiFilter) poiTypeFilter).wrapResultMatcher(rm); + } + SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest((int) bbox.left, + (int) bbox.right, (int) bbox.top, (int) bbox.bottom, -1, poiTypeFilter, rm); + r.searchPoi(req); + resultMatcher.apiSearchRegionFinished(this, r, phrase); + } + } return true; } - private void searchPoi(SearchPhrase phrase, SearchResultMatcher resultMatcher, Object obj, String customName, SearchPoiTypeFilter ptf) throws IOException { - QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); - List oo = phrase.getOfflineIndexes(); - Set searchedPois = new TreeSet<>(); - for (BinaryMapIndexReader o : oo) { - ResultMatcher rm = getResultMatcher(phrase, resultMatcher, customName, o, searchedPois); - if (obj instanceof CustomSearchPoiFilter) { - rm = ((CustomSearchPoiFilter) obj).wrapResultMatcher(rm); - } - SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest( - (int) bbox.left, (int) bbox.right, - (int) bbox.top, (int) bbox.bottom, -1, ptf, - rm); - o.searchPoi(req); - resultMatcher.apiSearchRegionFinished(this, o, phrase); - } - } private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchResultMatcher resultMatcher, - final String customName, final BinaryMapIndexReader selected, + final String nameFilter, final BinaryMapIndexReader selected, final Set searchedPois) { - String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); - final NameStringMatcher phraseMatcher; - if (!Algorithms.isEmpty(unknownSearchPhrase)) { - phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS); - } else { - phraseMatcher = null; - } + // TODO +// String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); +// final NameStringMatcher phraseMatcher; +// if (!Algorithms.isEmpty(unknownSearchPhrase)) { +// phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS); +// } else { +// phraseMatcher = null; +// } final NameStringMatcher ns; - final boolean hasCustomName = !Algorithms.isEmpty(customName); + final boolean hasCustomName = !Algorithms.isEmpty(nameFilter); if (hasCustomName) { - ns = phrase.getNameStringMatcher(customName, phrase.isLastUnknownSearchWordComplete()); + ns = phrase.getNameStringMatcher(nameFilter, phrase.isLastUnknownSearchWordComplete()); } else { - ns = phrase.getNameStringMatcher(); + ns = phrase.getFirstUnknownNameStringMatcher(); } return new ResultMatcher() { @@ -930,13 +893,17 @@ public class SearchCoreFactory { res.localeName = object.getSubType(); } } - if (phrase.isUnknownSearchWordPresent() - && !(ns.matches(res.localeName) || ns.matches(res.otherNames))) { - String ref = object.getTagContent(Amenity.REF, null); - if(ref == null || !ns.matches(ref)) { - return false; + if (phrase.isUnknownSearchWordPresent()) { + if (ns.matches(res.localeName) || ns.matches(res.otherNames)) { + phrase.countUnknownWordsMatchMainResult(res); } else { - res.localeName += " " + ref; + String ref = object.getTagContent(Amenity.REF, null); + if (ref == null || !ns.matches(ref)) { + return false; + } else { + phrase.countUnknownWordsMatch(res, ref, null); + res.localeName += " " + ref; + } } } @@ -946,6 +913,7 @@ public class SearchCoreFactory { res.location = object.getLocation(); res.priority = SEARCH_AMENITY_BY_TYPE_PRIORITY; res.priorityDistance = 1; + if (phraseMatcher != null) { boolean unknownPhraseMatches = phraseMatcher.matches(res.localeName); AbstractPoiType unknownSearchWordPoiType = phrase.getUnknownSearchWordPoiType(); @@ -969,7 +937,6 @@ public class SearchCoreFactory { } private SearchPoiTypeFilter getPoiTypeFilter(AbstractPoiType pt) { - acceptedTypes.clear(); poiAdditionals.clear(); updateTypesToAccept(pt); @@ -1045,16 +1012,8 @@ public class SearchCoreFactory { sw.getResult().file.preloadStreets(c, null); } int limit = 0; - String wordToSearch = phrase.getUnknownWordToSearch(); - boolean firstUnknownWordMatches = wordToSearch.equals(phrase.getUnknownSearchWord()); - NameStringMatcher nm = phrase.getNameStringMatcher(wordToSearch, phrase.isUnknownSearchWordComplete()); - String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); - NameStringMatcher phraseMatcher = null; - if (!Algorithms.isEmpty(unknownSearchPhrase)) { - phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS); - } + NameStringMatcher nm = phrase.getMainUnknownNameStringMatcher(); for (Street object : c.getStreets()) { - SearchResult res = new SearchResult(phrase); res.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); @@ -1067,12 +1026,6 @@ public class SearchCoreFactory { && !(nm.matches(res.localeName) || nm.matches(res.otherNames))) { continue; } - res.firstUnknownWordMatches = firstUnknownWordMatches || - phrase.getNameStringMatcher().matches(res.localeName) || - phrase.getNameStringMatcher().matches(res.otherNames); - if (phraseMatcher != null) { - res.unknownPhraseMatches = phraseMatcher.matches(res.localeName); - } res.localeRelatedObjectName = c.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); res.object = object; res.preferredZoom = 17; @@ -1102,11 +1055,6 @@ public class SearchCoreFactory { } - public static boolean isLastWordCityGroup(SearchPhrase p ) { - return p.isLastWord(ObjectType.CITY) || p.isLastWord(ObjectType.POSTCODE) || - p.isLastWord(ObjectType.VILLAGE); - } - public static class SearchBuildingAndIntersectionsByStreetAPI extends SearchBaseAPI { Street cacheBuilding; @@ -1179,7 +1127,7 @@ public class SearchCoreFactory { }); } String lw = phrase.getUnknownWordToSearchBuilding(); - NameStringMatcher buildingMatch = phrase.getNameStringMatcher(lw, phrase.isLastUnknownSearchWordComplete()); + NameStringMatcher buildingMatch = phrase.getUnknownWordToSearchBuildingNameMatcher(); NameStringMatcher startMatch = new NameStringMatcher(lw, StringMatcherMode.CHECK_ONLY_STARTS_WITH); for (Building b : s.getBuildings()) { SearchResult res = new SearchResult(phrase); @@ -1194,6 +1142,7 @@ public class SearchCoreFactory { res.file = file; res.priority = priority; res.priorityDistance = 0; + // TOOO phrase.countUnknownWordsMatchMainResult(res); res.firstUnknownWordMatches = startMatch.matches(res.localeName); res.relatedObject = s; res.localeRelatedObjectName = s.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); @@ -1208,7 +1157,7 @@ public class SearchCoreFactory { resultMatcher.publish(res); } String streetIntersection = phrase.getUnknownWordToSearch(); - NameStringMatcher streetMatch = phrase.getNameStringMatcher(streetIntersection, phrase.isLastUnknownSearchWordComplete()); + NameStringMatcher streetMatch = phrase.getMainUnknownNameStringMatcher(); if (Algorithms.isEmpty(streetIntersection) || (!Character.isDigit(streetIntersection.charAt(0)) && CommonWords.getCommonSearch(streetIntersection) == -1) ) { @@ -1218,6 +1167,7 @@ public class SearchCoreFactory { || !phrase.isSearchTypeAllowed(ObjectType.STREET_INTERSECTION)) { continue; } + // TOOO phrase.countUnknownWordsMatchMainResult(res); res.otherNames = street.getAllNames(true); res.localeName = street.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); res.object = street; @@ -1404,4 +1354,22 @@ public class SearchCoreFactory { return cachedParsedCode == null ? SEARCH_LOCATION_PRIORITY : SEARCH_MAX_PRIORITY; } } + + private static String stripBraces(String localeName) { + int i = localeName.indexOf('('); + String retName = localeName; + if (i > -1) { + retName = localeName.substring(0, i); + int j = localeName.indexOf(')', i); + if (j > -1) { + retName = retName.trim() + ' ' + localeName.substring(j); + } + } + return retName; + } + + public static boolean isLastWordCityGroup(SearchPhrase p ) { + return p.isLastWord(ObjectType.CITY) || p.isLastWord(ObjectType.POSTCODE) || + p.isLastWord(ObjectType.VILLAGE); + } } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 3e153f906e..d07ac45042 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -1,7 +1,7 @@ package net.osmand.search.core; import net.osmand.Collator; -import net.osmand.CollatorStringMatcher; +import net.osmand.CollatorStringMatcher;import net.osmand.OsmAndCollator; import net.osmand.CollatorStringMatcher.StringMatcherMode; import net.osmand.StringMatcher; import net.osmand.binary.BinaryMapIndexReader; @@ -10,6 +10,7 @@ import net.osmand.binary.CommonWords; import net.osmand.data.LatLon; import net.osmand.data.QuadRect; import net.osmand.osm.AbstractPoiType; +import net.osmand.search.core.SearchPhrase.NameStringMatcher; import net.osmand.util.Algorithms; import net.osmand.util.LocationParser; import net.osmand.util.MapUtils; @@ -27,31 +28,39 @@ import java.util.Set; import java.util.TreeSet; import java.util.regex.Pattern; -//immutable object +// Immutable object ! public class SearchPhrase { - - private List words = new ArrayList<>(); - private List unknownWords = new ArrayList<>(); - private List unknownWordsMatcher = new ArrayList<>(); - private String unknownSearchWordTrim; - private String rawUnknownSearchPhrase = ""; - private String unknownSearchPhrase = ""; - private AbstractPoiType unknownSearchWordPoiType; - private List unknownSearchWordPoiTypes = null; - - private NameStringMatcher sm; - private SearchSettings settings; - private List indexes; - - private QuadRect cache1kmRect; - private boolean lastUnknownSearchWordComplete; private static final String DELIMITER = " "; private static final String ALLDELIMITERS = "\\s|,"; private static final Pattern reg = Pattern.compile(ALLDELIMITERS); - private Collator clt; private static Comparator commonWordsComparator; - private static Set conjunctions = new TreeSet<>(); + + private final Collator clt; + private final SearchSettings settings; + private List indexes; + + // Object consists of 2 part [known + unknown] + private String fullTextSearchPhrase = ""; + private String unknownSearchPhrase = ""; + + // Words of 2 parts + private List words = new ArrayList<>(); + private String firstUnknownSearchWord = ""; + private List otherUnknownWords = new ArrayList<>(); + private boolean lastUnknownSearchWordComplete; + + // Main unknown word used for search + private String mainUnknownWordToSearch = null; + private boolean mainUnknownSearchWordComplete; + + // Name Searchers + private NameStringMatcher firstUnknownNameStringMatcher; + private NameStringMatcher mainUnknownNameStringMatcher; + private List unknownWordsMatcher = new ArrayList<>(); + + private QuadRect cache1kmRect; + static { // the conjunctions.add("the"); @@ -140,7 +149,7 @@ public class SearchPhrase { } - public SearchPhrase(SearchSettings settings, Collator clt) { + private SearchPhrase(SearchSettings settings, Collator clt) { this.settings = settings; this.clt = clt; } @@ -149,83 +158,160 @@ public class SearchPhrase { return clt; } + public SearchPhrase generateNewPhrase(String text, SearchSettings settings) { - SearchPhrase sp = new SearchPhrase(settings, this.clt); - String restText = text; + String textToSearch = text; List leftWords = this.words; String thisTxt = getText(true); + List foundWords = new ArrayList<>(); if (text.startsWith(thisTxt)) { // string is longer - restText = text.substring(getText(false).length()); - sp.words = new ArrayList<>(this.words); + textToSearch = text.substring(getText(false).length()); + foundWords.addAll(this.words); leftWords = leftWords.subList(leftWords.size(), leftWords.size()); } - for(SearchWord w : leftWords) { - if(restText.startsWith(w.getWord() + DELIMITER)) { - sp.words.add(w); - restText = restText.substring(w.getWord().length() + DELIMITER.length()); + for (SearchWord w : leftWords) { + if (textToSearch.startsWith(w.getWord() + DELIMITER)) { + foundWords.add(w); + textToSearch = textToSearch.substring(w.getWord().length() + DELIMITER.length()); } else { break; } } - sp.rawUnknownSearchPhrase = text; - sp.unknownSearchPhrase = restText; - sp.unknownWords.clear(); - sp.unknownWordsMatcher.clear(); + SearchPhrase sp = createNewSearchPhrase(settings, text, foundWords, textToSearch); + return sp; + } + + + public static SearchPhrase emptyPhrase() { + return emptyPhrase(null); + } + + public static SearchPhrase emptyPhrase(SearchSettings settings) { + return emptyPhrase(settings, OsmAndCollator.primaryCollator()); + } + + public static SearchPhrase emptyPhrase(SearchSettings settings, Collator clt) { + return new SearchPhrase(settings, clt); + } + + // init search phrase + private SearchPhrase createNewSearchPhrase(SearchSettings settings, String fullText, List foundWords, + String textToSearch) { + SearchPhrase sp = new SearchPhrase(settings, this.clt); + sp.words = foundWords; + sp.fullTextSearchPhrase = fullText; + sp.unknownSearchPhrase = textToSearch; - if (!reg.matcher(restText).find()) { - sp.unknownSearchWordTrim = sp.unknownSearchPhrase.trim(); + if (!reg.matcher(textToSearch).find()) { + sp.firstUnknownSearchWord = sp.unknownSearchPhrase.trim(); } else { - sp.unknownSearchWordTrim = ""; - String[] ws = restText.split(ALLDELIMITERS); + sp.firstUnknownSearchWord = ""; + String[] ws = textToSearch.split(ALLDELIMITERS); boolean first = true; for (int i = 0; i < ws.length ; i++) { String wd = ws[i].trim(); if (wd.length() > 0 && !conjunctions.contains(wd.toLowerCase())) { if (first) { - sp.unknownSearchWordTrim = wd; + sp.firstUnknownSearchWord = wd; first = false; } else { - sp.unknownWords.add(wd); + sp.otherUnknownWords.add(wd); } } } } - sp.lastUnknownSearchWordComplete = false; - if (text.length() > 0 ) { - char ch = text.charAt(text.length() - 1); - sp.lastUnknownSearchWordComplete = ch == ' ' || ch == ',' || ch == '\r' || ch == '\n' - || ch == ';'; - } - + sp.lastUnknownSearchWordComplete = isTextComplete(fullText) ; return sp; } + public SearchPhrase selectWord(SearchResult res, List unknownWords, boolean lastComplete) { + SearchPhrase sp = new SearchPhrase(this.settings, this.clt); + addResult(res, sp); + SearchResult prnt = res.parentSearchResult; + while (prnt != null) { + addResult(prnt, sp); + prnt = prnt.parentSearchResult; + } + sp.words.addAll(0, this.words); + if (unknownWords != null) { + sp.lastUnknownSearchWordComplete = lastComplete; + StringBuilder genUnknownSearchPhrase = new StringBuilder(); + for (int i = 0; i < unknownWords.size(); i++) { + if (i == 0) { + sp.firstUnknownSearchWord = unknownWords.get(0); + } else { + sp.otherUnknownWords.add(unknownWords.get(i)); + } + genUnknownSearchPhrase.append(unknownWords.get(i)).append(" "); + } + sp.fullTextSearchPhrase = fullTextSearchPhrase; + sp.unknownSearchPhrase = genUnknownSearchPhrase.toString().trim(); + } + return sp; + } + + + private void calcMainUnknownWordToSearch() { + if (mainUnknownWordToSearch != null) { + return; + } + List unknownSearchWords = otherUnknownWords; + mainUnknownWordToSearch = firstUnknownSearchWord; + mainUnknownSearchWordComplete = lastUnknownSearchWordComplete; + if (unknownSearchWords.size() > 0) { + mainUnknownSearchWordComplete = true; + List searchWords = new ArrayList<>(unknownSearchWords); + searchWords.add(0, getFirstUnknownSearchWord()); + Collections.sort(searchWords, commonWordsComparator); + for (String s : searchWords) { + if (s.length() > 0 && !Character.isDigit(s.charAt(0)) && !LocationParser.isValidOLC(s)) { + mainUnknownWordToSearch = s.trim(); + int unknownInd = unknownSearchWords.indexOf(s); + if (!lastUnknownSearchWordComplete && unknownSearchWords.size() - 1 == unknownInd) { + mainUnknownSearchWordComplete = false; + } + break; + } + } + } + } public List getWords() { return words; } - public boolean isUnknownSearchWordComplete() { - return lastUnknownSearchWordComplete || unknownWords.size() > 0 || unknownSearchWordPoiType != null; + public boolean isMainUnknownSearchWordComplete() { + // return lastUnknownSearchWordComplete || otherUnknownWords.size() > 0 || unknownSearchWordPoiType != null; + // TODO unknownSearchWordPoiType != null;!!! + return mainUnknownSearchWordComplete; } + public boolean isLastUnknownSearchWordComplete() { return lastUnknownSearchWordComplete; } - - - public List getUnknownSearchWords() { - return unknownWords; - } + public NameStringMatcher getFullUnknownNameMatcher() { + // TODO investigate diesel 95 + if (isLastUnknownSearchWordComplete() || hasMoreThanOneUnknownSearchWord()) { + return new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.TRIM_AND_CHECK_ONLY_STARTS_WITH); + } else { + return new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_STARTS_FROM_SPACE); + } + } + + public boolean hasMoreThanOneUnknownSearchWord() { + return otherUnknownWords.size() > 0; + } + public List getUnknownSearchWords(Collection exclude) { - if(exclude == null || unknownWords.size() == 0 || exclude.size() == 0) { - return unknownWords; + if(exclude == null || otherUnknownWords.size() == 0 || exclude.size() == 0) { + return otherUnknownWords; } List l = new ArrayList<>(); - for(String uw : unknownWords) { + for(String uw : otherUnknownWords) { if(exclude == null || !exclude.contains(uw)) { l.add(uw); } @@ -234,12 +320,12 @@ public class SearchPhrase { } - public String getUnknownSearchWord() { - return unknownSearchWordTrim; + public String getFirstUnknownSearchWord() { + return firstUnknownSearchWord; } - public String getRawUnknownSearchPhrase() { - return rawUnknownSearchPhrase; + public String getFullSearchPhrase() { + return fullTextSearchPhrase; } public String getUnknownSearchPhrase() { @@ -247,66 +333,9 @@ public class SearchPhrase { } public boolean isUnknownSearchWordPresent() { - return unknownSearchWordTrim.length() > 0; + return firstUnknownSearchWord.length() > 0; } - public int getUnknownSearchWordLength() { - return unknownSearchWordTrim.length() ; - } - - public AbstractPoiType getUnknownSearchWordPoiType() { - return unknownSearchWordPoiType; - } - - public void setUnknownSearchWordPoiType(AbstractPoiType unknownSearchWordPoiType) { - this.unknownSearchWordPoiType = unknownSearchWordPoiType; - } - - public boolean hasUnknownSearchWordPoiType() { - return unknownSearchWordPoiType != null; - } - - public String getPoiNameFilter() { - return getPoiNameFilter(unknownSearchWordPoiType); - } - - public boolean hasUnknownSearchWordPoiTypes() { - return unknownSearchWordPoiTypes != null && unknownSearchWordPoiTypes.size() > 0; - } - - public List getUnknownSearchWordPoiTypes() { - return unknownSearchWordPoiTypes; - } - - public void setUnknownSearchWordPoiTypes(List unknownSearchWordPoiTypes) { - this.unknownSearchWordPoiTypes = unknownSearchWordPoiTypes; - for (AbstractPoiType pt : unknownSearchWordPoiTypes) { - if (getPoiNameFilter(pt) != null) { - setUnknownSearchWordPoiType(pt); - break; - } - } - } - - public String getPoiNameFilter(AbstractPoiType pt) { - String nameFilter = null; - if (pt != null) { - NameStringMatcher nm = getNameStringMatcher(getUnknownSearchWord(), true); - String unknownSearchPhrase = getUnknownSearchPhrase(); - String enTranslation = pt.getEnTranslation(); - String translation = pt.getTranslation(); - String synonyms = pt.getSynonyms(); - if (unknownSearchPhrase.length() >= enTranslation.length() && nm.matches(enTranslation)) { - nameFilter = unknownSearchPhrase.substring(enTranslation.length()).trim(); - } else if (unknownSearchPhrase.length() >= translation.length() && nm.matches(translation)) { - nameFilter = unknownSearchPhrase.substring(translation.length()).trim(); - } else if (unknownSearchPhrase.length() >= synonyms.length() && nm.matches(synonyms)) { - nameFilter = unknownSearchPhrase.substring(synonyms.length()).trim(); - } - } - return nameFilter; - } - public QuadRect getRadiusBBoxToSearch(int radius) { int radiusInMeters = getRadiusSearch(radius); QuadRect cache1kmRect = get1km31Rect(); @@ -459,31 +488,6 @@ public class SearchPhrase { return selectWord(res, null, false); } - public SearchPhrase selectWord(SearchResult res, List unknownWords, boolean lastComplete) { - SearchPhrase sp = new SearchPhrase(this.settings, this.clt); - addResult(res, sp); - SearchResult prnt = res.parentSearchResult; - while (prnt != null) { - addResult(prnt, sp); - prnt = prnt.parentSearchResult; - } - sp.words.addAll(0, this.words); - if (unknownWords != null) { - sp.lastUnknownSearchWordComplete = lastComplete; - StringBuilder genUnknownSearchPhrase = new StringBuilder(); - for (int i = 0; i < unknownWords.size(); i++) { - if (i == 0) { - sp.unknownSearchWordTrim = unknownWords.get(0); - } else { - sp.unknownWords.add(unknownWords.get(i)); - } - genUnknownSearchPhrase.append(unknownWords.get(i)).append(" "); - } - - sp.rawUnknownSearchPhrase = sp.unknownSearchPhrase = genUnknownSearchPhrase.toString().trim(); - } - return sp; - } private void addResult(SearchResult res, SearchPhrase sp) { SearchWord sw = new SearchWord(res.wordsSpan != null ? res.wordsSpan : res.localeName.trim(), res); @@ -513,16 +517,32 @@ public class SearchPhrase { return null; } - public NameStringMatcher getNameStringMatcher() { - if(sm != null) { - return sm; + public NameStringMatcher getMainUnknownNameStringMatcher() { + calcMainUnknownWordToSearch(); + if (mainUnknownNameStringMatcher == null) { + mainUnknownNameStringMatcher = getNameStringMatcher(mainUnknownWordToSearch, mainUnknownSearchWordComplete); } - sm = getNameStringMatcher(unknownSearchWordTrim, lastUnknownSearchWordComplete); - return sm; + return mainUnknownNameStringMatcher; + } + + public NameStringMatcher getFirstUnknownNameStringMatcher() { + if (firstUnknownNameStringMatcher == null) { + firstUnknownNameStringMatcher = getNameStringMatcher(firstUnknownSearchWord, lastUnknownSearchWordComplete); + } + return firstUnknownNameStringMatcher; + } + + public NameStringMatcher getUnknownNameStringMatcher(int i) { + while (unknownWordsMatcher.size() <= i) { + int ind = unknownWordsMatcher.size() - 1; + boolean completeMatch = ind < otherUnknownWords.size() - 1 || isLastUnknownSearchWordComplete(); + unknownWordsMatcher.add(getNameStringMatcher(otherUnknownWords.get(ind), completeMatch)); + } + return unknownWordsMatcher.get(i); } - public NameStringMatcher getNameStringMatcher(String word, boolean complete) { + private NameStringMatcher getNameStringMatcher(String word, boolean complete) { return new NameStringMatcher(word, (complete ? StringMatcherMode.CHECK_EQUALS_FROM_SPACE : @@ -544,12 +564,12 @@ public class SearchPhrase { } } - public String getText(boolean includeLastWord) { + public String getText(boolean includeUnknownPart) { StringBuilder sb = new StringBuilder(); for(SearchWord s : words) { - sb.append(s.getWord()).append(DELIMITER.trim() + " "); + sb.append(s.getWord()).append(DELIMITER); } - if(includeLastWord) { + if(includeUnknownPart) { sb.append(unknownSearchPhrase); } return sb.toString(); @@ -558,11 +578,11 @@ public class SearchPhrase { public String getTextWithoutLastWord() { StringBuilder sb = new StringBuilder(); List words = new ArrayList<>(this.words); - if(Algorithms.isEmpty(unknownSearchWordTrim) && words.size() > 0) { + if (Algorithms.isEmpty(unknownSearchPhrase.trim()) && words.size() > 0) { words.remove(words.size() - 1); } for(SearchWord s : words) { - sb.append(s.getWord()).append(DELIMITER.trim() + " "); + sb.append(s.getWord()).append(DELIMITER); } return sb.toString(); } @@ -705,8 +725,8 @@ public class SearchPhrase { private CollatorStringMatcher sm; - public NameStringMatcher(String lastWordTrim, StringMatcherMode mode) { - sm = new CollatorStringMatcher(lastWordTrim, mode); + public NameStringMatcher(String namePart, StringMatcherMode mode) { + sm = new CollatorStringMatcher(namePart, mode); } public boolean matches(Collection map) { @@ -728,35 +748,32 @@ public class SearchPhrase { } - public void countUnknownWordsMatch(SearchResult sr) { + public void countUnknownWordsMatchMainResult(SearchResult sr) { countUnknownWordsMatch(sr, sr.localeName, sr.otherNames); } + public void countUnknownWordsMatch(SearchResult sr, String localeName, Collection otherNames) { - if (unknownWords.size() > 0) { - for (int i = 0; i < unknownWords.size(); i++) { - if (unknownWordsMatcher.size() == i) { - unknownWordsMatcher.add(new NameStringMatcher(unknownWords.get(i), - i < unknownWords.size() - 1 || isLastUnknownSearchWordComplete() - ? StringMatcherMode.CHECK_EQUALS_FROM_SPACE - : StringMatcherMode.CHECK_STARTS_FROM_SPACE)); - } - NameStringMatcher ms = unknownWordsMatcher.get(i); + if (otherUnknownWords.size() > 0) { + for (int i = 0; i < otherUnknownWords.size(); i++) { + NameStringMatcher ms = getUnknownNameStringMatcher(i); if (ms.matches(localeName) || ms.matches(otherNames)) { if (sr.otherWordsMatch == null) { sr.otherWordsMatch = new TreeSet<>(); } - sr.otherWordsMatch.add(unknownWords.get(i)); + sr.otherWordsMatch.add(otherUnknownWords.get(i)); } } } if(!sr.firstUnknownWordMatches) { - sr.firstUnknownWordMatches = localeName.equals(getUnknownSearchWord()) || - getNameStringMatcher().matches(localeName) || - getNameStringMatcher().matches(otherNames); + sr.firstUnknownWordMatches = localeName.equals(getFirstUnknownSearchWord()) || + getFirstUnknownNameStringMatcher().matches(localeName) || + getFirstUnknownNameStringMatcher().matches(otherNames); } } + + public int getRadiusSearch(int meters, int radiusLevel) { int res = meters; for(int k = 0; k < radiusLevel; k++) { @@ -777,17 +794,38 @@ public class SearchPhrase { return (x < y) ? -1 : ((x == y) ? 0 : 1); } - public String getUnknownWordToSearchBuilding() { - List unknownSearchWords = getUnknownSearchWords(); - if(unknownSearchWords.size() > 0 && Algorithms.extractFirstIntegerNumber(getUnknownSearchWord()) == 0) { - for(String wrd : unknownSearchWords) { - if(Algorithms.extractFirstIntegerNumber(wrd) != 0) { - return wrd; + private int getUnknownWordToSearchBuildingInd() { + if (otherUnknownWords.size() > 0 && Algorithms.extractFirstIntegerNumber(getFirstUnknownSearchWord()) == 0) { + int ind = 0; + for (String wrd : otherUnknownWords) { + ind++; + if (Algorithms.extractFirstIntegerNumber(wrd) != 0) { + return ind; } } - } - return getUnknownSearchWord(); + } + return 0; } + + public NameStringMatcher getUnknownWordToSearchBuildingNameMatcher() { + int ind = getUnknownWordToSearchBuildingInd(); + if(ind > 0) { + return getUnknownNameStringMatcher(ind - 1); + } else { + return getFirstUnknownNameStringMatcher(); + } + } + + public String getUnknownWordToSearchBuilding() { + int ind = getUnknownWordToSearchBuildingInd(); + if(ind > 0) { + return otherUnknownWords.get(ind - 1); + } else { + return firstUnknownSearchWord; + } + } + + private static int lengthWithoutNumbers(String s) { int len = 0; @@ -802,19 +840,18 @@ public class SearchPhrase { } public String getUnknownWordToSearch() { - List unknownSearchWords = getUnknownSearchWords(); - String wordToSearch = getUnknownSearchWord(); - if (unknownSearchWords.size() > 0) { - List searchWords = new ArrayList<>(unknownSearchWords); - searchWords.add(0, getUnknownSearchWord()); - Collections.sort(searchWords, commonWordsComparator); - for (String s : searchWords) { - if (s.length() > 0 && !Character.isDigit(s.charAt(0)) && !LocationParser.isValidOLC(s)) { - return s; - } - } + calcMainUnknownWordToSearch(); + return mainUnknownWordToSearch; + } + + private boolean isTextComplete(String fullText) { + boolean lastUnknownSearchWordComplete = false; + if (fullText.length() > 0 ) { + char ch = fullText.charAt(fullText.length() - 1); + lastUnknownSearchWordComplete = ch == ' ' || ch == ',' || ch == '\r' || ch == '\n' + || ch == ';'; } - return wordToSearch; + return lastUnknownSearchWordComplete; } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index 269694eae9..957190d67d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -16,18 +16,33 @@ import java.util.Collection; public class SearchResult { // search phrase that makes search result valid public SearchPhrase requiredSearchPhrase; + + // internal package fields (used for sorting) + public SearchResult parentSearchResult; + String wordsSpan ; + // TODO + boolean firstUnknownWordMatches = true; + Collection otherWordsMatch = null; + boolean unknownPhraseMatches = false; + public Object object; public ObjectType objectType; public BinaryMapIndexReader file; - + public double priority; public double priorityDistance; - public String wordsSpan ; - public SearchResult parentSearchResult; - public Collection otherWordsMatch = null; - public boolean firstUnknownWordMatches = true; - public boolean unknownPhraseMatches = false; + + public LatLon location; + public int preferredZoom = 15; + + public String localeName; + public String alternateName; + public Collection otherNames; + + public String localeRelatedObjectName; + public Object relatedObject; + public double distRelatedObjectName; public SearchResult(SearchPhrase sp) { this.requiredSearchPhrase = sp; @@ -40,9 +55,14 @@ public class SearchResult { res = ObjectType.getTypeWeight(objectType); } if (parentSearchResult != null) { + // TODO // 10 > maximum type - // res = Math.max(res,parentSearchResult.getUnknownPhraseMatchWeight()) ; - res += parentSearchResult.getUnknownPhraseMatchWeight() / 10; +// double x = parentSearchResult.getUnknownPhraseMatchWeight(); +// if (x == 0) { +// return 0; +// } + // res = Math.max(res, parentSearchResult.getUnknownPhraseMatchWeight()); + res += parentSearchResult.getUnknownPhraseMatchWeight() / 10; } return res; } @@ -77,16 +97,6 @@ public class SearchResult { return priority - 1 / (1 + pd * distance); } - public LatLon location; - public int preferredZoom = 15; - public String localeName; - public String alternateName; - - public Collection otherNames; - - public String localeRelatedObjectName; - public Object relatedObject; - public double distRelatedObjectName; @Override public String toString() { diff --git a/OsmAnd-java/src/test/java/net/osmand/search/LocationSearchTest.java b/OsmAnd-java/src/test/java/net/osmand/search/LocationSearchTest.java index 3190115507..874a82aeb0 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/LocationSearchTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/LocationSearchTest.java @@ -17,7 +17,7 @@ public class LocationSearchTest { private void search(String string, LatLon latLon) throws IOException { SearchResultMatcher srm = new SearchUICore.SearchResultMatcher(null, null, 0, null, 100); new SearchCoreFactory.SearchLocationAndUrlAPI(). - search(new SearchPhrase(null, OsmAndCollator.primaryCollator()).generateNewPhrase(string, null), srm); + search(SearchPhrase.emptyPhrase().generateNewPhrase(string, null), srm); Assert.assertEquals(1, srm.getRequestResults().size()); Assert.assertEquals(latLon, srm.getRequestResults().get(0).location); } diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreGenericTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreGenericTest.java index aa4d7430d6..0c0b99b5ac 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreGenericTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreGenericTest.java @@ -8,7 +8,6 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import net.osmand.OsmAndCollator; import net.osmand.data.LatLon; import net.osmand.search.SearchUICore.SearchResultCollection; import net.osmand.search.core.SearchPhrase; @@ -29,7 +28,7 @@ public class SearchUICoreGenericTest { public void testDuplicates() throws IOException { SearchSettings ss = new SearchSettings((SearchSettings)null); ss = ss.setOriginalLocation(new LatLon(0, 0)); - SearchPhrase phrase = new SearchPhrase(ss, OsmAndCollator.primaryCollator()); + SearchPhrase phrase = SearchPhrase.emptyPhrase(ss); SearchResultCollection cll = new SearchUICore.SearchResultCollection(phrase); List rs = new ArrayList<>(); SearchResult a1 = searchResult(rs, phrase, "a", 100); @@ -47,7 +46,7 @@ public class SearchUICoreGenericTest { public void testNoResort() throws IOException { SearchSettings ss = new SearchSettings((SearchSettings)null); ss = ss.setOriginalLocation(new LatLon(0, 0)); - SearchPhrase phrase = new SearchPhrase(ss, OsmAndCollator.primaryCollator()); + SearchPhrase phrase = SearchPhrase.emptyPhrase(ss); SearchResultCollection cll = new SearchUICore.SearchResultCollection(phrase); List rs = new ArrayList<>(); SearchResult a1 = searchResult(rs, phrase, "a", 100); @@ -80,7 +79,7 @@ public class SearchUICoreGenericTest { public void testNoResortDuplicate() throws IOException { SearchSettings ss = new SearchSettings((SearchSettings)null); ss = ss.setOriginalLocation(new LatLon(0, 0)); - SearchPhrase phrase = new SearchPhrase(ss, OsmAndCollator.primaryCollator()); + SearchPhrase phrase = SearchPhrase.emptyPhrase(ss); SearchResultCollection cll = new SearchUICore.SearchResultCollection(phrase); List rs = new ArrayList<>(); SearchResult a1 = searchResult(rs, phrase, "a", 100); diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 13c9668741..566f9b19ae 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -152,7 +152,7 @@ public class SearchUICoreTest { SearchSettings s = SearchSettings.parseJSON(settingsJson); s.setOfflineIndexes(Collections.singletonList(reader)); - SearchPhrase phrase = new SearchPhrase(s, OsmAndCollator.primaryCollator()); + SearchPhrase phrase = SearchPhrase.emptyPhrase(s); phrase = phrase.generateNewPhrase(phraseText, s); final SearchUICore core = new SearchUICore(MapPoiTypes.getDefault(), "en", false); diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java index 078908ad1e..3d5aac0ebe 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java @@ -351,11 +351,11 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC cancelSearch(); SearchPhrase searchPhrase = searchUICore.getPhrase(); if (foundPartialLocation) { - QuickSearchCoordinatesFragment.showDialog(QuickSearchDialogFragment.this, searchPhrase.getUnknownSearchWord()); + QuickSearchCoordinatesFragment.showDialog(QuickSearchDialogFragment.this, searchPhrase.getFirstUnknownSearchWord()); } else if (searchPhrase.isNoSelectedType() || searchPhrase.isLastWord(POI_TYPE)) { PoiUIFilter filter; if (searchPhrase.isNoSelectedType()) { - if (isOnlineSearch() && !Algorithms.isEmpty(searchPhrase.getUnknownSearchWord())) { + if (isOnlineSearch() && !Algorithms.isEmpty(searchPhrase.getFirstUnknownSearchWord())) { app.getPoiFilters().resetNominatimFilters(); filter = app.getPoiFilters().getNominatimPOIFilter(); filter.setFilterByName(searchPhrase.getUnknownSearchPhrase()); @@ -369,8 +369,8 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC } } else { filter = app.getPoiFilters().getSearchByNamePOIFilter(); - if (!Algorithms.isEmpty(searchPhrase.getUnknownSearchWord())) { - filter.setFilterByName(searchPhrase.getUnknownSearchWord()); + if (!Algorithms.isEmpty(searchPhrase.getFirstUnknownSearchWord())) { + filter.setFilterByName(searchPhrase.getFirstUnknownSearchWord()); filter.clearCurrentResults(); } } @@ -382,8 +382,8 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC .getResult().object; filter = new PoiUIFilter(abstractPoiType, app, ""); } - if (!Algorithms.isEmpty(searchPhrase.getUnknownSearchWord())) { - filter.setFilterByName(searchPhrase.getUnknownSearchWord()); + if (!Algorithms.isEmpty(searchPhrase.getFirstUnknownSearchWord())) { + filter.setFilterByName(searchPhrase.getFirstUnknownSearchWord()); } } else { filter = (PoiUIFilter) searchPhrase.getLastSelectedWord().getResult().object; @@ -628,9 +628,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC @Override public void onClick(View v) { if (searchEditText.getText().length() > 0) { - String newText = searchUICore.getPhrase().getTextWithoutLastWord(); - searchEditText.setText(newText); - searchEditText.setSelection(newText.length()); + clearLastWord(); } else if (useMapCenter && location != null) { useMapCenter = false; centerLatLon = null; diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java index e51454e548..c5f23f741f 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java @@ -123,7 +123,7 @@ public class QuickSearchHelper implements ResourceListener { public void refreshFilterOrders() { PoiFiltersHelper filtersHelper = app.getPoiFilters(); - core.setFilterOrders(filtersHelper.getPoiFilterOrders(true)); + core.setActivePoiFiltersByOrder(filtersHelper.getPoiFilterOrders(true)); } public void setRepositoriesForSearchUICore(final OsmandApplication app) { @@ -353,7 +353,7 @@ public class QuickSearchHelper implements ResourceListener { public boolean search(SearchPhrase phrase, SearchResultMatcher matcher) throws IOException { double lat = phrase.getSettings().getOriginalLocation().getLatitude(); double lon = phrase.getSettings().getOriginalLocation().getLongitude(); - String text = phrase.getRawUnknownSearchPhrase(); + String text = phrase.getFullSearchPhrase(); filter.setFilterByName(text); publishAmenities(phrase, matcher, filter.initializeNewSearch(lat, lon, -1, null, phrase.getRadiusLevel() + 3)); diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java index 8c95d7562c..5d91713579 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java @@ -785,13 +785,6 @@ public class QuickSearchDialogFragment extends DialogFragment implements SampleC runCoreSearch(txt, false, false); } - public void clearLastWord() { - if (searchEditText.getText().length() > 0) { - String newText = searchUICore.getPhrase().getTextWithoutLastWord(); - searchEditText.setText(newText); - searchEditText.setSelection(newText.length()); - } - } private void addMoreButton() { QuickSearchMoreListItem moreListItem = From c52054dadcf129b867e4604f12e2b9eb6168c614 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 00:34:41 +0200 Subject: [PATCH 02/26] Fix compilation problems --- .../net/osmand/CollatorStringMatcher.java | 8 --- .../java/net/osmand/search/SearchUICore.java | 2 +- .../osmand/search/core/SearchCoreFactory.java | 62 +++++++++---------- .../net/osmand/search/core/SearchPhrase.java | 11 +--- .../net/osmand/search/core/SearchResult.java | 7 ++- 5 files changed, 37 insertions(+), 53 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java b/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java index f44ea9855d..bd1a208cfc 100644 --- a/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java +++ b/OsmAnd-java/src/main/java/net/osmand/CollatorStringMatcher.java @@ -25,9 +25,6 @@ public class CollatorStringMatcher implements StringMatcher { CHECK_STARTS_FROM_SPACE_NOT_BEGINNING, // tests all words (split by space) and one of word should be equal to part CHECK_EQUALS_FROM_SPACE, - // TO DO: make a separate method - // trims part to make shorter then full text and tests only first word as base starts with part - TRIM_AND_CHECK_ONLY_STARTS_WITH, // simple collator contains in any part of the base CHECK_CONTAINS, // simple collator equals @@ -62,11 +59,6 @@ public class CollatorStringMatcher implements StringMatcher { return cstartsWith(collator, fullName, part, false, true, false); case CHECK_ONLY_STARTS_WITH: return cstartsWith(collator, fullName, part, true, false, false); - case TRIM_AND_CHECK_ONLY_STARTS_WITH: - if (part.length() > fullName.length()) { - part = part.substring(0, fullName.length()); - } - return cstartsWith(collator, fullName, part, true, false, false); case CHECK_EQUALS: return cstartsWith(collator, fullName, part, false, false, true); } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index 5e7ed1d9d7..fde107912d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -71,7 +71,7 @@ public class SearchUICore { taskQueue = new LinkedBlockingQueue(); searchSettings = new SearchSettings(new ArrayList()); searchSettings = searchSettings.setLang(locale, transliterate); - phrase = SearchPhrase.emptyPhrase(); + phrase = SearchPhrase.emptyPhrase(searchSettings); currentSearchResult = new SearchResultCollection(phrase); singleThreadedExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, taskQueue); } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index d88578c6ed..d5d039ef16 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -48,8 +48,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; -import gnu.trove.list.array.TIntArrayList; - public class SearchCoreFactory { @@ -678,7 +676,7 @@ public class SearchCoreFactory { @Override public boolean search(SearchPhrase phrase, SearchResultMatcher resultMatcher) throws IOException { boolean showTopFiltersOnly = !phrase.isUnknownSearchWordPresent(); - NameStringMatcher nm = phrase.getFullUnknownNameMatcher(); + NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); initPoiTypes(); List poiTypes = topVisibleFilters; if (!showTopFiltersOnly) { @@ -818,18 +816,18 @@ public class SearchCoreFactory { throw new UnsupportedOperationException(); } } else if (searchAmenityTypesAPI != null) { - NameStringMatcher nm = phrase.getFullUnknownNameMatcher(); + NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); searchAmenityTypesAPI.initPoiTypes(); List presentPoiTypes = searchAmenityTypesAPI.getPoiTypeResults(nm, false); - // TODO get first ? - AbstractPoiType poiType = phrase.getUnknownSearchWordPoiType(); - if (poiType != null) { - poiTypeFilter = getPoiTypeFilter(poiType); - nameFilter = phrase.getPoiNameFilter(poiType); - if (nameFilter != null) { - phrase.setUnknownSearchWordPoiType(poiType); - } - } + // TODO get first ? !!! +// AbstractPoiType poiType = phrase.getUnknownSearchWordPoiType(); +// if (poiType != null) { +// poiTypeFilter = getPoiTypeFilter(poiType); +// nameFilter = phrase.getPoiNameFilter(poiType); +// if (nameFilter != null) { +// phrase.setUnknownSearchWordPoiType(poiType); +// } +// } } if (poiTypeFilter != null) { QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); @@ -853,7 +851,7 @@ public class SearchCoreFactory { private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchResultMatcher resultMatcher, final String nameFilter, final BinaryMapIndexReader selected, final Set searchedPois) { - // TODO + // TODO !!! // String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); // final NameStringMatcher phraseMatcher; // if (!Algorithms.isEmpty(unknownSearchPhrase)) { @@ -861,13 +859,14 @@ public class SearchCoreFactory { // } else { // phraseMatcher = null; // } - final NameStringMatcher ns; - final boolean hasCustomName = !Algorithms.isEmpty(nameFilter); - if (hasCustomName) { - ns = phrase.getNameStringMatcher(nameFilter, phrase.isLastUnknownSearchWordComplete()); - } else { - ns = phrase.getFirstUnknownNameStringMatcher(); - } +// final NameStringMatcher ns; +// final boolean hasCustomName = !Algorithms.isEmpty(nameFilter); +// if (hasCustomName) { +// ns = phrase.getNameStringMatcher(nameFilter, phrase.isLastUnknownSearchWordComplete()); +// } else { +// ns = phrase.getFirstUnknownNameStringMatcher(); +// } + NameStringMatcher ns = phrase.getFirstUnknownNameStringMatcher(); return new ResultMatcher() { @Override @@ -914,16 +913,17 @@ public class SearchCoreFactory { res.priority = SEARCH_AMENITY_BY_TYPE_PRIORITY; res.priorityDistance = 1; - if (phraseMatcher != null) { - boolean unknownPhraseMatches = phraseMatcher.matches(res.localeName); - AbstractPoiType unknownSearchWordPoiType = phrase.getUnknownSearchWordPoiType(); - if (unknownPhraseMatches && unknownSearchWordPoiType != null) { - unknownPhraseMatches = !phraseMatcher.matches(unknownSearchWordPoiType.getTranslation()) - && !phraseMatcher.matches(unknownSearchWordPoiType.getEnTranslation()) - && !phraseMatcher.matches(unknownSearchWordPoiType.getSynonyms()); - } - res.unknownPhraseMatches = unknownPhraseMatches; - } + // TODO !!! +// if (phraseMatcher != null) { +// boolean unknownPhraseMatches = phraseMatcher.matches(res.localeName); +// AbstractPoiType unknownSearchWordPoiType = phrase.getUnknownSearchWordPoiType(); +// if (unknownPhraseMatches && unknownSearchWordPoiType != null) { +// unknownPhraseMatches = !phraseMatcher.matches(unknownSearchWordPoiType.getTranslation()) +// && !phraseMatcher.matches(unknownSearchWordPoiType.getEnTranslation()) +// && !phraseMatcher.matches(unknownSearchWordPoiType.getSynonyms()); +// } +// res.unknownPhraseMatches = unknownPhraseMatches; +// } res.objectType = ObjectType.POI; resultMatcher.publish(res); return false; diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index d07ac45042..cc36617798 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -293,15 +293,6 @@ public class SearchPhrase { return lastUnknownSearchWordComplete; } - public NameStringMatcher getFullUnknownNameMatcher() { - // TODO investigate diesel 95 - if (isLastUnknownSearchWordComplete() || hasMoreThanOneUnknownSearchWord()) { - return new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.TRIM_AND_CHECK_ONLY_STARTS_WITH); - } else { - return new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_STARTS_FROM_SPACE); - } - } - public boolean hasMoreThanOneUnknownSearchWord() { return otherUnknownWords.size() > 0; } @@ -534,7 +525,7 @@ public class SearchPhrase { public NameStringMatcher getUnknownNameStringMatcher(int i) { while (unknownWordsMatcher.size() <= i) { - int ind = unknownWordsMatcher.size() - 1; + int ind = unknownWordsMatcher.size(); boolean completeMatch = ind < otherUnknownWords.size() - 1 || isLastUnknownSearchWordComplete(); unknownWordsMatcher.add(getNameStringMatcher(otherUnknownWords.get(ind), completeMatch)); } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index 957190d67d..7186f90fa3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -55,14 +55,15 @@ public class SearchResult { res = ObjectType.getTypeWeight(objectType); } if (parentSearchResult != null) { - // TODO - // 10 > maximum type // double x = parentSearchResult.getUnknownPhraseMatchWeight(); // if (x == 0) { // return 0; // } // res = Math.max(res, parentSearchResult.getUnknownPhraseMatchWeight()); - res += parentSearchResult.getUnknownPhraseMatchWeight() / 10; + // res += parentSearchResult.getUnknownPhraseMatchWeight() / 10; + // 20 > maximum type + // TODO explain comment + res = res / 20 + parentSearchResult.getUnknownPhraseMatchWeight() / 20; } return res; } From a474d6bea73c18159f668c14c6025933061fa70c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 17:52:16 +0200 Subject: [PATCH 03/26] Fix todo's --- .../java/net/osmand/search/SearchUICore.java | 2 +- .../osmand/search/core/SearchCoreFactory.java | 37 ++++--------------- .../net/osmand/search/core/SearchPhrase.java | 3 -- .../net/osmand/search/core/SearchResult.java | 18 ++++----- 4 files changed, 16 insertions(+), 44 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index fde107912d..5765f08049 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -713,7 +713,7 @@ public class SearchUICore { @Override public boolean publish(SearchResult object) { - // TODO first , other? + // TODO Check names and count first , other? if (phrase != null && object.otherNames != null && !phrase.getFirstUnknownNameStringMatcher().matches(object.localeName)) { for (String s : object.otherNames) { if (phrase.getFirstUnknownNameStringMatcher().matches(s)) { diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index d5d039ef16..359ab84468 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -819,7 +819,9 @@ public class SearchCoreFactory { NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); searchAmenityTypesAPI.initPoiTypes(); List presentPoiTypes = searchAmenityTypesAPI.getPoiTypeResults(nm, false); + // TODO get first ? !!! + // TODO SELECT WORD // AbstractPoiType poiType = phrase.getUnknownSearchWordPoiType(); // if (poiType != null) { // poiTypeFilter = getPoiTypeFilter(poiType); @@ -828,6 +830,10 @@ public class SearchCoreFactory { // phrase.setUnknownSearchWordPoiType(poiType); // } // } +// unknownPhraseMatches = !phraseMatcher.matches(unknownSearchWordPoiType.getTranslation()) +// && !phraseMatcher.matches(unknownSearchWordPoiType.getEnTranslation()) +// && !phraseMatcher.matches(unknownSearchWordPoiType.getSynonyms()); +// } } if (poiTypeFilter != null) { QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); @@ -851,21 +857,6 @@ public class SearchCoreFactory { private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchResultMatcher resultMatcher, final String nameFilter, final BinaryMapIndexReader selected, final Set searchedPois) { - // TODO !!! -// String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim(); -// final NameStringMatcher phraseMatcher; -// if (!Algorithms.isEmpty(unknownSearchPhrase)) { -// phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS); -// } else { -// phraseMatcher = null; -// } -// final NameStringMatcher ns; -// final boolean hasCustomName = !Algorithms.isEmpty(nameFilter); -// if (hasCustomName) { -// ns = phrase.getNameStringMatcher(nameFilter, phrase.isLastUnknownSearchWordComplete()); -// } else { -// ns = phrase.getFirstUnknownNameStringMatcher(); -// } NameStringMatcher ns = phrase.getFirstUnknownNameStringMatcher(); return new ResultMatcher() { @@ -876,10 +867,10 @@ public class SearchCoreFactory { } SearchResult res = new SearchResult(phrase); String poiID = object.getType().getKeyName() + "_" + object.getId(); - if(!searchedPois.add(poiID)) { + if (!searchedPois.add(poiID)) { return false; } - if(object.isClosed()) { + if (object.isClosed()) { return false; } res.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); @@ -912,18 +903,6 @@ public class SearchCoreFactory { res.location = object.getLocation(); res.priority = SEARCH_AMENITY_BY_TYPE_PRIORITY; res.priorityDistance = 1; - - // TODO !!! -// if (phraseMatcher != null) { -// boolean unknownPhraseMatches = phraseMatcher.matches(res.localeName); -// AbstractPoiType unknownSearchWordPoiType = phrase.getUnknownSearchWordPoiType(); -// if (unknownPhraseMatches && unknownSearchWordPoiType != null) { -// unknownPhraseMatches = !phraseMatcher.matches(unknownSearchWordPoiType.getTranslation()) -// && !phraseMatcher.matches(unknownSearchWordPoiType.getEnTranslation()) -// && !phraseMatcher.matches(unknownSearchWordPoiType.getSynonyms()); -// } -// res.unknownPhraseMatches = unknownPhraseMatches; -// } res.objectType = ObjectType.POI; resultMatcher.publish(res); return false; diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index cc36617798..5e8a0e4092 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -9,8 +9,6 @@ import net.osmand.binary.BinaryMapIndexReader.SearchRequest; import net.osmand.binary.CommonWords; import net.osmand.data.LatLon; import net.osmand.data.QuadRect; -import net.osmand.osm.AbstractPoiType; -import net.osmand.search.core.SearchPhrase.NameStringMatcher; import net.osmand.util.Algorithms; import net.osmand.util.LocationParser; import net.osmand.util.MapUtils; @@ -284,7 +282,6 @@ public class SearchPhrase { public boolean isMainUnknownSearchWordComplete() { // return lastUnknownSearchWordComplete || otherUnknownWords.size() > 0 || unknownSearchWordPoiType != null; - // TODO unknownSearchWordPoiType != null;!!! return mainUnknownSearchWordComplete; } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index 7186f90fa3..6d3bf2458b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -20,7 +20,6 @@ public class SearchResult { // internal package fields (used for sorting) public SearchResult parentSearchResult; String wordsSpan ; - // TODO boolean firstUnknownWordMatches = true; Collection otherWordsMatch = null; boolean unknownPhraseMatches = false; @@ -47,23 +46,20 @@ public class SearchResult { public SearchResult(SearchPhrase sp) { this.requiredSearchPhrase = sp; } + private static final double MAX_TYPE_WEIGHT = 10; + // maximum corresponds to the top entry + // this method returns: + // [1, 4] - if there is no parent search result + // [0, 1[ - if there is parent search result public double getUnknownPhraseMatchWeight() { // if result is a complete match in the search we prioritize it highers - double res = 0; + double res = 0; if (unknownPhraseMatches) { res = ObjectType.getTypeWeight(objectType); } if (parentSearchResult != null) { -// double x = parentSearchResult.getUnknownPhraseMatchWeight(); -// if (x == 0) { -// return 0; -// } - // res = Math.max(res, parentSearchResult.getUnknownPhraseMatchWeight()); - // res += parentSearchResult.getUnknownPhraseMatchWeight() / 10; - // 20 > maximum type - // TODO explain comment - res = res / 20 + parentSearchResult.getUnknownPhraseMatchWeight() / 20; + res = (res + parentSearchResult.getUnknownPhraseMatchWeight() / MAX_TYPE_WEIGHT) / MAX_TYPE_WEIGHT; } return res; } From 107fc81ed93cb7950e60ad51093eac74c40c684b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 18:31:19 +0200 Subject: [PATCH 04/26] Fix poi type search --- .../osmand/search/core/SearchCoreFactory.java | 134 ++++++++++++------ .../net/osmand/search/core/SearchPhrase.java | 20 ++- 2 files changed, 108 insertions(+), 46 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index 359ab84468..ef53e7cf7e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -1,6 +1,7 @@ package net.osmand.search.core; +import net.osmand.CollatorStringMatcher; import net.osmand.CollatorStringMatcher.StringMatcherMode; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapAddressReaderAdapter; @@ -624,38 +625,27 @@ public class SearchCoreFactory { } } - public List getPoiTypeResults(NameStringMatcher nm, boolean includeAdditionals) { - List results = new ArrayList(); + public Map> getPoiTypeResults(NameStringMatcher nm, boolean includeAdditionals) { + Map> results = new LinkedHashMap<>(); for (AbstractPoiType pf : topVisibleFilters) { - if (nm.matches(pf.getTranslation()) || nm.matches(pf.getEnTranslation()) - || nm.matches(pf.getSynonyms())) { - results.add(pf); - } + checkPoiType(nm, pf, results); } for (PoiCategory c : categories) { - if (!results.contains(c) && (nm.matches(c.getTranslation()) || nm.matches(c.getEnTranslation()) - || nm.matches(c.getSynonyms()))) { - results.add(c); - } + checkPoiType(nm, c, results); } Iterator> it = translatedNames.entrySet().iterator(); while (it.hasNext()) { Entry e = it.next(); PoiType pt = e.getValue(); if (pt.getCategory() != types.getOtherMapCategory()) { - if (!results.contains(pt) && (nm.matches(pt.getEnTranslation()) || nm.matches(pt.getTranslation()) - || nm.matches(pt.getSynonyms()))) { - results.add(pt); - } + checkPoiType(nm, pt, results); List additionals = pt.getPoiAdditionals(); if (additionals != null && includeAdditionals) { for (PoiType a : additionals) { - if (!results.contains(a)) { + if (!results.containsKey(a)) { String enTranslation = a.getEnTranslation().toLowerCase(); - if (!"yes".equals(enTranslation) && !"no".equals(enTranslation) - && (nm.matches(enTranslation) || nm.matches(a.getTranslation()) - || nm.matches(a.getSynonyms()))) { - results.add(a); + if (!"yes".equals(enTranslation) && !"no".equals(enTranslation)) { + checkPoiType(nm, a, results); } } } @@ -665,6 +655,33 @@ public class SearchCoreFactory { return results; } + private void checkPoiType(NameStringMatcher nm, AbstractPoiType pf, Map> results) { + List lst = results.get(pf); + if (nm.matches(pf.getTranslation())) { + lst = addToList(pf.getTranslation(), lst); + } + if (nm.matches(pf.getEnTranslation())) { + lst = addToList(pf.getEnTranslation(), lst); + } + + if (nm.matches(pf.getSynonyms())) { + String[] synonyms = pf.getSynonyms().split(";"); + for (String synonym : synonyms) { + if (nm.matches(synonym)) { + lst = addToList(synonym, lst); + } + } + } + } + + private List addToList(String s, List lst) { + if(lst == null) { + lst = new ArrayList<>(); + } + lst.add(s); + return lst; + } + private void initPoiTypes() { if (translatedNames.isEmpty()) { translatedNames = types.getAllTranslatedNames(false); @@ -678,15 +695,36 @@ public class SearchCoreFactory { boolean showTopFiltersOnly = !phrase.isUnknownSearchWordPresent(); NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); initPoiTypes(); - List poiTypes = topVisibleFilters; - if (!showTopFiltersOnly) { - poiTypes = getPoiTypeResults(nm, true); - } - for (AbstractPoiType pt : poiTypes) { - SearchResult res = new SearchResult(phrase); - res.localeName = pt.getTranslation(); - res.object = pt; - addPoiTypeResult(phrase, resultMatcher, showTopFiltersOnly, getStandardFilterId(pt), res); + if (showTopFiltersOnly) { + for (AbstractPoiType pt : topVisibleFilters) { + SearchResult res = new SearchResult(phrase); + res.localeName = pt.getTranslation(); + res.object = pt; + addPoiTypeResult(phrase, resultMatcher, showTopFiltersOnly, getStandardFilterId(pt), res); + } + + } else { + Map> poiTypes = getPoiTypeResults(nm, true); + for (Entry> pt : poiTypes.entrySet()) { + boolean match = !phrase.isFirstUnknownSearchWordComplete(); + if (!match) { + for (String foundName : pt.getValue()) { + CollatorStringMatcher csm = new CollatorStringMatcher(foundName, StringMatcherMode.CHECK_ONLY_STARTS_WITH); + match = csm.matches(phrase.getUnknownSearchPhrase()); + if (match) { + break; + } + } + // TODO properly count matching words + } + if (match) { + SearchResult res = new SearchResult(phrase); + res.localeName = pt.getKey().getTranslation(); + res.object = pt.getKey(); + addPoiTypeResult(phrase, resultMatcher, showTopFiltersOnly, getStandardFilterId(pt.getKey()), + res); + } + } } for (int i = 0; i < customPoiFilters.size(); i++) { CustomSearchPoiFilter csf = customPoiFilters.get(i); @@ -815,25 +853,31 @@ public class SearchCoreFactory { } else { throw new UnsupportedOperationException(); } - } else if (searchAmenityTypesAPI != null) { + } else if (searchAmenityTypesAPI != null && phrase.isFirstUnknownSearchWordComplete()) { NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); searchAmenityTypesAPI.initPoiTypes(); - List presentPoiTypes = searchAmenityTypesAPI.getPoiTypeResults(nm, false); - - // TODO get first ? !!! - // TODO SELECT WORD -// AbstractPoiType poiType = phrase.getUnknownSearchWordPoiType(); -// if (poiType != null) { -// poiTypeFilter = getPoiTypeFilter(poiType); -// nameFilter = phrase.getPoiNameFilter(poiType); -// if (nameFilter != null) { -// phrase.setUnknownSearchWordPoiType(poiType); -// } -// } -// unknownPhraseMatches = !phraseMatcher.matches(unknownSearchWordPoiType.getTranslation()) -// && !phraseMatcher.matches(unknownSearchWordPoiType.getEnTranslation()) -// && !phraseMatcher.matches(unknownSearchWordPoiType.getSynonyms()); -// } + Map> poiTypeResults = searchAmenityTypesAPI.getPoiTypeResults(nm, false); + // find first full match only + for (Entry> poiType : poiTypeResults.entrySet()) { + for (String foundName : poiType.getValue()) { + CollatorStringMatcher csm = new CollatorStringMatcher(foundName, StringMatcherMode.CHECK_ONLY_STARTS_WITH); + // matches only completely + if (csm.matches(phrase.getUnknownSearchPhrase())) { + int words = phrase.countWords(foundName) - 1; + List otherSearchWords = phrase.getUnknownSearchWords(null); + if (words < otherSearchWords.size()) { + nameFilter = ""; + for(int k = words; k < otherSearchWords.size(); k++) { + nameFilter = otherSearchWords.get(k) + SearchPhrase.DELIMITER; + } + nameFilter = nameFilter.trim(); + } + poiTypeFilter = getPoiTypeFilter(poiType.getKey()); + break; + } + } + } + // TODO count correctly matching words ! } if (poiTypeFilter != null) { QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 5e8a0e4092..6a4bfe9083 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -28,7 +28,7 @@ import java.util.regex.Pattern; // Immutable object ! public class SearchPhrase { - private static final String DELIMITER = " "; + public static final String DELIMITER = " "; private static final String ALLDELIMITERS = "\\s|,"; private static final Pattern reg = Pattern.compile(ALLDELIMITERS); private static Comparator commonWordsComparator; @@ -223,6 +223,18 @@ public class SearchPhrase { return sp; } + public int countWords(String w) { + String[] ws = w.split(ALLDELIMITERS); + int cnt = 0; + for (int i = 0; i < ws.length; i++) { + String wd = ws[i].trim(); + if (wd.length() > 0) { + cnt++; + } + } + return cnt; + } + public SearchPhrase selectWord(SearchResult res, List unknownWords, boolean lastComplete) { SearchPhrase sp = new SearchPhrase(this.settings, this.clt); addResult(res, sp); @@ -311,6 +323,10 @@ public class SearchPhrase { public String getFirstUnknownSearchWord() { return firstUnknownSearchWord; } + + public boolean isFirstUnknownSearchWordComplete() { + return hasMoreThanOneUnknownSearchWord() || isLastUnknownSearchWordComplete(); + } public String getFullSearchPhrase() { return fullTextSearchPhrase; @@ -843,4 +859,6 @@ public class SearchPhrase { } + + } From 0929c79fd7688f29642262b7f98f7404bb0fc81f Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 19:28:57 +0200 Subject: [PATCH 05/26] Fix poi additional search --- .../java/net/osmand/search/SearchUICore.java | 1 + .../osmand/search/core/SearchCoreFactory.java | 81 ++++++++++--------- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index 5765f08049..2ab65f570c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -721,6 +721,7 @@ public class SearchUICore { break; } } + // TODO if (Algorithms.isEmpty(object.alternateName) && object.object instanceof Amenity) { for (String value : ((Amenity) object.object).getAdditionalInfo().values()) { if (phrase.getFirstUnknownNameStringMatcher().matches(value)) { diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index ef53e7cf7e..be8f9f1243 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -21,7 +21,6 @@ import net.osmand.data.Street; import net.osmand.osm.AbstractPoiType; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; -import net.osmand.osm.PoiFilter; import net.osmand.osm.PoiType; import net.osmand.search.SearchUICore.SearchResultMatcher; import net.osmand.search.core.SearchPhrase.NameStringMatcher; @@ -657,6 +656,7 @@ public class SearchCoreFactory { private void checkPoiType(NameStringMatcher nm, AbstractPoiType pf, Map> results) { List lst = results.get(pf); + boolean nl = lst == null; if (nm.matches(pf.getTranslation())) { lst = addToList(pf.getTranslation(), lst); } @@ -672,6 +672,9 @@ public class SearchCoreFactory { } } } + if(lst != null && nl) { + results.put(pf, lst); + } } private List addToList(String s, List lst) { @@ -715,7 +718,7 @@ public class SearchCoreFactory { break; } } - // TODO properly count matching words + // TODO properly count matching words fuel diesel } if (match) { SearchResult res = new SearchResult(phrase); @@ -792,9 +795,11 @@ public class SearchCoreFactory { public static class SearchAmenityByTypeAPI extends SearchBaseAPI { private static final int BBOX_RADIUS = 10000; private SearchAmenityTypesAPI searchAmenityTypesAPI; - private MapPoiTypes types; - + private Map> acceptedTypes = new LinkedHashMap>(); + private Map poiAdditionals = new HashMap(); + public SearchAmenityByTypeAPI(MapPoiTypes types, SearchAmenityTypesAPI searchAmenityTypesAPI) { super(ObjectType.POI); this.types = types; @@ -816,27 +821,11 @@ public class SearchCoreFactory { return phrase.getNextRadiusSearch(BBOX_RADIUS); } - private Map> acceptedTypes = new LinkedHashMap>(); - private Map poiAdditionals = new HashMap(); + public void updateTypesToAccept(AbstractPoiType pt) { pt.putTypes(acceptedTypes); if (pt instanceof PoiType && ((PoiType) pt).isAdditional() && ((PoiType) pt).getParentType() != null) { - fillPoiAdditionals(((PoiType) pt).getParentType()); - } else { - fillPoiAdditionals(pt); - } - } - - private void fillPoiAdditionals(AbstractPoiType pt) { - for (PoiType add : pt.getPoiAdditionals()) { - poiAdditionals.put(add.getKeyName().replace('_', ':').replace(' ', ':'), add); - poiAdditionals.put(add.getTranslation().replace(' ', ':').toLowerCase(), add); - } - if (pt instanceof PoiFilter && !(pt instanceof PoiCategory)) { - for (PoiType ps : ((PoiFilter) pt).getPoiTypes()) { - fillPoiAdditionals(ps); - } + poiAdditionals.put(pt.getKeyName(), (PoiType) pt); } } @@ -853,38 +842,43 @@ public class SearchCoreFactory { } else { throw new UnsupportedOperationException(); } + nameFilter = phrase.getUnknownSearchPhrase(); } else if (searchAmenityTypesAPI != null && phrase.isFirstUnknownSearchWordComplete()) { NameStringMatcher nm = phrase.getFirstUnknownNameStringMatcher(); searchAmenityTypesAPI.initPoiTypes(); - Map> poiTypeResults = searchAmenityTypesAPI.getPoiTypeResults(nm, false); + Map> poiTypeResults = searchAmenityTypesAPI.getPoiTypeResults(nm, true); // find first full match only + int maxwords = 0; for (Entry> poiType : poiTypeResults.entrySet()) { for (String foundName : poiType.getValue()) { CollatorStringMatcher csm = new CollatorStringMatcher(foundName, StringMatcherMode.CHECK_ONLY_STARTS_WITH); // matches only completely - if (csm.matches(phrase.getUnknownSearchPhrase())) { - int words = phrase.countWords(foundName) - 1; + int mwords = phrase.countWords(foundName) ; + if (csm.matches(phrase.getUnknownSearchPhrase()) && maxwords < mwords) { + maxwords = phrase.countWords(foundName); List otherSearchWords = phrase.getUnknownSearchWords(null); - if (words < otherSearchWords.size()) { + nameFilter = null; + if (maxwords - 1 < otherSearchWords.size()) { nameFilter = ""; - for(int k = words; k < otherSearchWords.size(); k++) { - nameFilter = otherSearchWords.get(k) + SearchPhrase.DELIMITER; + for(int k = maxwords - 1; k < otherSearchWords.size(); k++) { + if(nameFilter.length() > 0) { + nameFilter += SearchPhrase.DELIMITER; + } + nameFilter += otherSearchWords.get(k); } - nameFilter = nameFilter.trim(); } poiTypeFilter = getPoiTypeFilter(poiType.getKey()); - break; } } } - // TODO count correctly matching words ! + // TODO count correctly matching words ! fuel diesel } if (poiTypeFilter != null) { QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); List offlineIndexes = phrase.getOfflineIndexes(); Set searchedPois = new TreeSet<>(); for (BinaryMapIndexReader r : offlineIndexes) { - ResultMatcher rm = getResultMatcher(phrase, resultMatcher, nameFilter, r, searchedPois); + ResultMatcher rm = getResultMatcher(phrase, poiTypeFilter, resultMatcher, nameFilter, r, searchedPois); if (poiTypeFilter instanceof CustomSearchPoiFilter) { rm = ((CustomSearchPoiFilter) poiTypeFilter).wrapResultMatcher(rm); } @@ -898,10 +892,11 @@ public class SearchCoreFactory { } - private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchResultMatcher resultMatcher, - final String nameFilter, final BinaryMapIndexReader selected, - final Set searchedPois) { - NameStringMatcher ns = phrase.getFirstUnknownNameStringMatcher(); + private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchPoiTypeFilter poiTypeFilter, + final SearchResultMatcher resultMatcher, final String nameFilter, + final BinaryMapIndexReader selected, final Set searchedPois) { + + NameStringMatcher ns = nameFilter == null ? null : new NameStringMatcher(nameFilter, StringMatcherMode.CHECK_STARTS_FROM_SPACE); return new ResultMatcher() { @Override @@ -917,6 +912,18 @@ public class SearchCoreFactory { if (object.isClosed()) { return false; } + if (!poiAdditionals.isEmpty()) { + boolean found = false; + for (String add : poiAdditionals.keySet()) { + if(object.getAdditionalInfo().containsKey(add)) { + found = true; + break; + } + } + if (!found) { + return false; + } + } res.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); res.otherNames = object.getAllNames(true); if (Algorithms.isEmpty(res.localeName)) { @@ -927,7 +934,7 @@ public class SearchCoreFactory { res.localeName = object.getSubType(); } } - if (phrase.isUnknownSearchWordPresent()) { + if (ns != null) { if (ns.matches(res.localeName) || ns.matches(res.otherNames)) { phrase.countUnknownWordsMatchMainResult(res); } else { From 0e45fd77fc393d1c4f6c06262bf3e47484978f17 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 19:41:18 +0200 Subject: [PATCH 06/26] Fix weight --- .../src/main/java/net/osmand/search/SearchUICore.java | 4 ++-- .../src/main/java/net/osmand/search/core/SearchResult.java | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index 2ab65f570c..73fb590903 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -857,8 +857,8 @@ public class SearchUICore { private enum ResultCompareStep { TOP_VISIBLE, - FOUND_WORD_COUNT, - UNKNOWN_PHRASE_MATCH_WEIGHT, + FOUND_WORD_COUNT, // more is better (top) + UNKNOWN_PHRASE_MATCH_WEIGHT, // more is better (top) SEARCH_DISTANCE_IF_NOT_BY_NAME, COMPARE_FIRST_NUMBER_IN_NAME, COMPARE_DISTANCE_TO_PARENT_SEARCH_RESULT, // makes sense only for inner subqueries diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index 6d3bf2458b..b93a4f640b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -22,7 +22,6 @@ public class SearchResult { String wordsSpan ; boolean firstUnknownWordMatches = true; Collection otherWordsMatch = null; - boolean unknownPhraseMatches = false; public Object object; @@ -54,10 +53,7 @@ public class SearchResult { // [0, 1[ - if there is parent search result public double getUnknownPhraseMatchWeight() { // if result is a complete match in the search we prioritize it highers - double res = 0; - if (unknownPhraseMatches) { - res = ObjectType.getTypeWeight(objectType); - } + double res = ObjectType.getTypeWeight(objectType); if (parentSearchResult != null) { res = (res + parentSearchResult.getUnknownPhraseMatchWeight() / MAX_TYPE_WEIGHT) / MAX_TYPE_WEIGHT; } From 5b8ef9160ee3132c586ec6394c0758b1ecf901ce Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 20:13:01 +0200 Subject: [PATCH 07/26] Update search ui core test --- .../osmand/search/core/SearchCoreFactory.java | 30 ++++++++----------- .../net/osmand/search/core/SearchPhrase.java | 30 ++++++++++++++----- .../net/osmand/search/SearchUICoreTest.java | 4 +-- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index be8f9f1243..2b9a6437e8 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -455,7 +455,7 @@ public class SearchCoreFactory { City ct = ((Street) res.object).getCity(); phrase.countUnknownWordsMatch(res, ct.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()), - ct.getAllNames(true)); + ct.getAllNames(true), 0); subSearchApiOrPublish(phrase, resultMatcher, res, streetsApi); } else { subSearchApiOrPublish(phrase, resultMatcher, res, cityApi); @@ -482,15 +482,12 @@ public class SearchCoreFactory { if (!phrase.isUnknownSearchWordPresent()) { return false; } - // TODO - // consider 'bar' - 'Hospital 512' if (!phrase.isNoSelectedType()) { // don't search by name when type is selected or poi type is part of name return false; } - // boolean hasUnselectedType = phrase.isNoSelectedType() && phrase.isUnknownSearchWordPresent() - // && phrase.isMainUnknownSearchWordComplete() && phrase.hasUnknownSearchWordPoiTypes(); - // Check feedback before it was searching exact match of whole phrase.getUnknownSearchPhrase() + // Take into account POI [bar] - 'Hospital 512' + // BEFORE: it was searching exact match of whole phrase.getUnknownSearchPhrase() [ Check feedback ] final BinaryMapIndexReader[] currentFile = new BinaryMapIndexReader[1]; Iterator offlineIterator = phrase.getRadiusOfflineIndexes(BBOX_RADIUS, @@ -718,7 +715,6 @@ public class SearchCoreFactory { break; } } - // TODO properly count matching words fuel diesel } if (match) { SearchResult res = new SearchResult(phrase); @@ -833,6 +829,7 @@ public class SearchCoreFactory { public boolean search(final SearchPhrase phrase, final SearchResultMatcher resultMatcher) throws IOException { SearchPoiTypeFilter poiTypeFilter = null; String nameFilter = null; + int countExtraWords = 0; if (phrase.isLastWord(ObjectType.POI_TYPE)) { Object obj = phrase.getLastSelectedWord().getResult().object; if (obj instanceof AbstractPoiType) { @@ -848,19 +845,18 @@ public class SearchCoreFactory { searchAmenityTypesAPI.initPoiTypes(); Map> poiTypeResults = searchAmenityTypesAPI.getPoiTypeResults(nm, true); // find first full match only - int maxwords = 0; for (Entry> poiType : poiTypeResults.entrySet()) { for (String foundName : poiType.getValue()) { CollatorStringMatcher csm = new CollatorStringMatcher(foundName, StringMatcherMode.CHECK_ONLY_STARTS_WITH); // matches only completely int mwords = phrase.countWords(foundName) ; - if (csm.matches(phrase.getUnknownSearchPhrase()) && maxwords < mwords) { - maxwords = phrase.countWords(foundName); + if (csm.matches(phrase.getUnknownSearchPhrase()) && countExtraWords < mwords) { + countExtraWords = phrase.countWords(foundName); List otherSearchWords = phrase.getUnknownSearchWords(null); nameFilter = null; - if (maxwords - 1 < otherSearchWords.size()) { + if (countExtraWords - 1 < otherSearchWords.size()) { nameFilter = ""; - for(int k = maxwords - 1; k < otherSearchWords.size(); k++) { + for(int k = countExtraWords - 1; k < otherSearchWords.size(); k++) { if(nameFilter.length() > 0) { nameFilter += SearchPhrase.DELIMITER; } @@ -871,14 +867,13 @@ public class SearchCoreFactory { } } } - // TODO count correctly matching words ! fuel diesel } if (poiTypeFilter != null) { QuadRect bbox = phrase.getRadiusBBoxToSearch(BBOX_RADIUS); List offlineIndexes = phrase.getOfflineIndexes(); Set searchedPois = new TreeSet<>(); for (BinaryMapIndexReader r : offlineIndexes) { - ResultMatcher rm = getResultMatcher(phrase, poiTypeFilter, resultMatcher, nameFilter, r, searchedPois); + ResultMatcher rm = getResultMatcher(phrase, poiTypeFilter, resultMatcher, nameFilter, r, searchedPois, countExtraWords); if (poiTypeFilter instanceof CustomSearchPoiFilter) { rm = ((CustomSearchPoiFilter) poiTypeFilter).wrapResultMatcher(rm); } @@ -894,7 +889,8 @@ public class SearchCoreFactory { private ResultMatcher getResultMatcher(final SearchPhrase phrase, final SearchPoiTypeFilter poiTypeFilter, final SearchResultMatcher resultMatcher, final String nameFilter, - final BinaryMapIndexReader selected, final Set searchedPois) { + final BinaryMapIndexReader selected, final Set searchedPois, + final int countExtraWords) { NameStringMatcher ns = nameFilter == null ? null : new NameStringMatcher(nameFilter, StringMatcherMode.CHECK_STARTS_FROM_SPACE); return new ResultMatcher() { @@ -936,13 +932,13 @@ public class SearchCoreFactory { } if (ns != null) { if (ns.matches(res.localeName) || ns.matches(res.otherNames)) { - phrase.countUnknownWordsMatchMainResult(res); + phrase.countUnknownWordsMatchMainResult(res, countExtraWords); } else { String ref = object.getTagContent(Amenity.REF, null); if (ref == null || !ns.matches(ref)) { return false; } else { - phrase.countUnknownWordsMatch(res, ref, null); + phrase.countUnknownWordsMatch(res, ref, null, countExtraWords); res.localeName += " " + ref; } } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 6a4bfe9083..439988e1f7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -753,15 +753,27 @@ public class SearchPhrase { } public void countUnknownWordsMatchMainResult(SearchResult sr) { - countUnknownWordsMatch(sr, sr.localeName, sr.otherNames); + countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, 0); + } + + public void countUnknownWordsMatchMainResult(SearchResult sr, int startsWith) { + countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, startsWith); } - public void countUnknownWordsMatch(SearchResult sr, String localeName, Collection otherNames) { + public void countUnknownWordsMatch(SearchResult sr, String localeName, Collection otherNames, int startWith) { if (otherUnknownWords.size() > 0) { for (int i = 0; i < otherUnknownWords.size(); i++) { - NameStringMatcher ms = getUnknownNameStringMatcher(i); - if (ms.matches(localeName) || ms.matches(otherNames)) { + boolean match = false; + if (i < startWith - 1) { + match = true; + } else { + NameStringMatcher ms = getUnknownNameStringMatcher(i); + if (ms.matches(localeName) || ms.matches(otherNames)) { + match = true; + } + } + if (match) { if (sr.otherWordsMatch == null) { sr.otherWordsMatch = new TreeSet<>(); } @@ -769,10 +781,12 @@ public class SearchPhrase { } } } - if(!sr.firstUnknownWordMatches) { - sr.firstUnknownWordMatches = localeName.equals(getFirstUnknownSearchWord()) || - getFirstUnknownNameStringMatcher().matches(localeName) || - getFirstUnknownNameStringMatcher().matches(otherNames); + if (startWith > 0) { + sr.firstUnknownWordMatches = true; + } else if (!sr.firstUnknownWordMatches) { + sr.firstUnknownWordMatches = localeName.equals(getFirstUnknownSearchWord()) + || getFirstUnknownNameStringMatcher().matches(localeName) + || getFirstUnknownNameStringMatcher().matches(otherNames); } } diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 566f9b19ae..50595ad099 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -61,8 +61,8 @@ public class SearchUICoreTest { Map enPhrases = new HashMap<>(); Map phrases = new HashMap<>(); try { - enPhrases = Algorithms.parseStringsXml(new File("src/test/resources/phrases/en/phrases.xml")); - //phrases = Algorithms.parseStringsXml(new File("src/test/resources/phrases/ru/phrases.xml")); + enPhrases = Algorithms.parseStringsXml(new File("src/test/resources/en/phrases.xml")); + //phrases = Algorithms.parseStringsXml(new File("src/test/resources/ru/phrases.xml")); phrases = enPhrases; } catch (IOException e) { e.printStackTrace(); From 32798d167a67dcdbeaafc0225e29a1d0ddb3a4e7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 20:52:02 +0200 Subject: [PATCH 08/26] Fix search test --- .../src/main/java/net/osmand/search/core/SearchPhrase.java | 2 +- .../src/test/java/net/osmand/search/SearchUICoreTest.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 439988e1f7..83958f46a6 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -783,7 +783,7 @@ public class SearchPhrase { } if (startWith > 0) { sr.firstUnknownWordMatches = true; - } else if (!sr.firstUnknownWordMatches) { + } else { sr.firstUnknownWordMatches = localeName.equals(getFirstUnknownSearchWord()) || getFirstUnknownNameStringMatcher().matches(localeName) || getFirstUnknownNameStringMatcher().matches(otherNames); diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 50595ad099..7833c8da8f 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -183,7 +183,6 @@ public class SearchUICoreTest { System.out.println(String.format("Mismatch for '%s' != '%s' (%d, %.3f, %s). Result: ", expected, present, result.getFoundWordCount(), result.getUnknownPhraseMatchWeight(), result.objectType.toString())); for (SearchResult r : searchResults) { -// System.out.println(String.format("\t\"%s\",", r.toString())); System.out.println(String.format("\"%s\", (%d, %.3f, %s),", r.toString(), r.getFoundWordCount(), r.getUnknownPhraseMatchWeight(), r.objectType.toString())); } From 40fe15ca9d181df9ef0e57603640ad75f6550c3d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 21:03:21 +0200 Subject: [PATCH 09/26] Fix tests --- .../test/resources/search/navacerrada.json | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/navacerrada.json b/OsmAnd-java/src/test/resources/search/navacerrada.json index 27653999ba..17c09093e4 100644 --- a/OsmAnd-java/src/test/resources/search/navacerrada.json +++ b/OsmAnd-java/src/test/resources/search/navacerrada.json @@ -11,7 +11,6 @@ }, "phrase": "Calle de las eras 5, Navacerrada", "results": [ -<<<<<<< HEAD "5, Calle de las Eras (Uranización Los Corales), Navacerrada" ], "extra-results": [ @@ -74,45 +73,7 @@ "Calle Dos Castillas, Puerto de Navacerrada", "Travesía de las Huertas, Navacerrada", "Vereda de las Encinillas, Navacerrada", - "Centro Municipal de Mayores «Navacerrada»", -======= - "5, Calle de las Eras (Uranización Los Corales), Navacerrada", - "5, Calle Navacerrada (Urb. Las Suertes), Las Suertes", - "50, Calle de Francisco Navacerrada, Salamanca", - "52, Calle de Francisco Navacerrada, Salamanca", - "53, Calle de Francisco Navacerrada, Salamanca", - "54, Calle de Francisco Navacerrada, Salamanca", - "55, Calle de Francisco Navacerrada, Salamanca", - "56, Calle de Francisco Navacerrada, Salamanca", - "57, Calle de Francisco Navacerrada, Salamanca", - "58, Calle de Francisco Navacerrada, Salamanca", - "59, Calle de Francisco Navacerrada, Salamanca", - "Calle del Puerto de Navacerrada, Las Nieves", - "Calle Puerto de Navacerrada, La Poveda", - "Calle del Embalse de Navacerrada, Villa de Vallecas", - "Calle del Puerto de Navacerrada, Puente de Vallecas", - "Calle de Francisco Navacerrada, Salamanca", - "Calle de Navacerrada, Moraleja de Enmedio", - "Calle Navacerrada (Urb. Las Suertes), Las Suertes", - "Calle Puerto de Navacerrada, Roman Candelas", - "Calle Navacerrada, Becerril de la Sierra", - "Carretera de Collado Villalba a Navacerrada, El Baillo y las Hojarascas", - "Calle Navacerrada (Cerceda), El Boalo", - "Calle Navacerrada (El Pedregal), Bustarviejo", - "Calle Navacerrada, Buitrago del Lozoya", - "Carretera de Colmenar Viejo a Navacerrada, Becerril de la Sierra", - "Carretera de Colmenar Viejo a Navacerrada, Manzanares el Real", - "Carretera de Collado Villalba a Navacerrada, Dehesa Boyal", - "Carretera de Collado Villalba a Navacerrada, Polideportivo Dehesa Boyal", - "Carretera de Navacerrada, Jazmines", - "Carretera de Colmenar Viejo a Navacerrada (Cerceda), El Boalo", - "Carretera de Collado Villalba a Navacerrada, Cerca de Cascarrilla", - "Carretera de Navacerrada, El Boalo", - "Carretera de Collado Villalba a Navacerrada, Collado Mediano", - "Camino de Navacerrada (Serranía de la Paloma), Collado Mediano", - "Camino de Los Molinos a Navacerrada, Collado Mediano", - "Carretera de Collado Villalba a Navacerrada, Navacerrada" ->>>>>>> e69e0d95cc... Added search test + "Centro Municipal de Mayores «Navacerrada»" ], "amenities": [ { From 60c609f12a033ee21d9e87893d61cc7a044368ff Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 22:27:17 +0200 Subject: [PATCH 10/26] Fix tests --- .../net/osmand/search/SearchUICoreTest.java | 19 +++-- .../test/resources/search/burger_king.json | 37 +++++++--- .../resources/search/street_santa_clara.json | 72 +++++++++++++------ 3 files changed, 92 insertions(+), 36 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 7833c8da8f..12c469f6e7 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -35,6 +35,7 @@ import net.osmand.search.core.SearchPhrase; import net.osmand.search.core.SearchResult; import net.osmand.search.core.SearchSettings; import net.osmand.util.Algorithms; +import net.osmand.util.MapUtils; @RunWith(Parameterized.class) public class SearchUICoreTest { @@ -179,12 +180,22 @@ public class SearchUICoreTest { for (SearchResult result : searchResults) { String expected = results.get(i++); String present = result.toString(); + boolean fullFormat = true; + String fmt = fullFormat? "\"%s\", (%d, %s, %.3f, %.2f km)," : "\t\"%s\","; if (!Algorithms.stringsEqual(expected, present)) { - System.out.println(String.format("Mismatch for '%s' != '%s' (%d, %.3f, %s). Result: ", expected, - present, result.getFoundWordCount(), result.getUnknownPhraseMatchWeight(), result.objectType.toString())); + System.out.println(String.format("Mismatch for '%s' != '%s' (%d, %s, %.3f). Result: ", expected, + present, result.getFoundWordCount(), result.objectType.toString(), + result.getUnknownPhraseMatchWeight())); for (SearchResult r : searchResults) { - System.out.println(String.format("\"%s\", (%d, %.3f, %s),", r.toString(), - r.getFoundWordCount(), r.getUnknownPhraseMatchWeight(), r.objectType.toString())); + double dist = 0; + if(r.location != null) { + dist = MapUtils.getDistance(r.location, phrase.getLastTokenLocation()); + } + System.out.println(String.format(fmt, r.toString(), + r.getFoundWordCount(), r.objectType.toString(), + r.getUnknownPhraseMatchWeight(), + dist / 1000 + )); } } Assert.assertEquals(expected, present); diff --git a/OsmAnd-java/src/test/resources/search/burger_king.json b/OsmAnd-java/src/test/resources/search/burger_king.json index 78f2ecd72a..072dc45481 100644 --- a/OsmAnd-java/src/test/resources/search/burger_king.json +++ b/OsmAnd-java/src/test/resources/search/burger_king.json @@ -11,17 +11,32 @@ }, "phrase": "Burger King", "results": [ - "Burger (Cafe / Cafe and restaurant)", - "Burger (Pub / Food)", - "Burger (Bar / Food)", - "Burger (Restaurant / Cafe and restaurant)", - "Burger (Biergarten / Food)", - "Burger (Fast food / Food)", - "Burger King", - "Burger King", - "Burger King", - "Burger King", - "Burger King" + "Burger (Cafe / Cafe and restaurant)", + "Burger (Pub / Food)", + "Burger (Bar / Food)", + "Burger (Restaurant / Cafe and restaurant)", + "Burger (Biergarten / Food)", + "Burger (Fast food / Food)", + "Burger King Thiendorf", + "Burger King", + "Burger King", + "Burger King", + "Burger King", + "Burger King", + "Burger King Riesa", + "Burger King", + "Bürger King Chemnitz", + "Burger King Chemnitz", + "Burger King", + "Burger King", + "Burger King", + "Burger King", + "Burger King Glauchau", + "Burger King", + "Burger King", + "Burger King", + "Burger King", + "Burger King" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/street_santa_clara.json b/OsmAnd-java/src/test/resources/search/street_santa_clara.json index 48d7643a62..45c0c9e276 100644 --- a/OsmAnd-java/src/test/resources/search/street_santa_clara.json +++ b/OsmAnd-java/src/test/resources/search/street_santa_clara.json @@ -12,28 +12,58 @@ "phrase": "santa clara", "results": [ "Carrer de Santa Clara, Sant Pol de Mar", - "Santa Clara, Sant Pol de Mar", - "Carrer Santa Clara, Sant Pol de Mar", - "Plaça Santa Clara, Santa Coloma de Farners", - "Carrer del Comte de Santa Clara, Barcelona", - "Carrer del Comte de Santa Clara, la Barceloneta", - "Passatge de Santa Clara, Barcelona", - "Passatge de Santa Clara, Barri Gòtic", - "Baixada de Santa Clara, Barcelona", - "Baixada de Santa Clara, Barri Gòtic", - "Carrer de Santa Clara, Girona", - "Plaça de Santa Clara, Vic", - "Carrer de Santa Clara, Poble Nou", - "Carrer de Santa Clara (Poble Nou), Sant Vicenç dels Horts", - "Carrer Vell de Santa Clara, Manresa", - "Carrer Nou de Santa Clara, Centre Històric", - "Carrer Nou de Santa Clara (Les Escodines), Manresa", - "Carrer de Santa Clara, Masquefa", - "Carrer Santa Clara, Castelló d'Empúries", - "Carrer de Santa Clara, Vilafranca del Penedès", - "Carrer de Santa Clara, Castelló d'Empúries", - "Carrer Clara Campoamor, Santa Coloma de Gramenet" + "Santa Clara, Sant Pol de Mar", + "Carrer Santa Clara, Sant Pol de Mar", + "Plaça Santa Clara, Santa Coloma de Farners", + "Carrer del Comte de Santa Clara, Barcelona", + "Carrer del Comte de Santa Clara, la Barceloneta", + "Passatge de Santa Clara, Barcelona", + "Passatge de Santa Clara, Barri Gòtic", + "Baixada de Santa Clara, Barcelona", + "Baixada de Santa Clara, Barri Gòtic", + "Carrer de Santa Clara, Girona", + "Plaça de Santa Clara, Vic", + "Carrer de Santa Clara, Poble Nou", + "Carrer de Santa Clara (Poble Nou), Sant Vicenç dels Horts", + "Carrer Vell de Santa Clara, Manresa", + "Carrer Nou de Santa Clara, Centre Històric", + "Carrer Nou de Santa Clara (Les Escodines), Manresa", + "Carrer de Santa Clara, Masquefa", + "Carrer Santa Clara, Castelló d'Empúries", + "Carrer de Santa Clara, Vilafranca del Penedès", + "Carrer de Santa Clara, Castelló d'Empúries", + "Santa Clara", + "Santa Clara", + "Santa Clara", + "Santa Clara", + "Pastisseria Santa Clara", + "Escola Santa Clara", + "Santa Clara", + "L11 - Santa Clara", + "Santa Clara", + "CAP SANTA CLARA", + "CAP Santa Clara", + "L11 - Santa Clara", + "Plaça de Santa Clara", + "Pl. Santa Clara", + "Santa Clara de Olimar", + "Claverol / Santa Clara", + "Monestir de Santa Clara", + "Santa Clara", + "La Sínia de Santa Clara", + "Restaurant Santa Clara", + "Hostal Santa Clara", + "Santa Maria del Castell de Claramunt", + "Monestir de Santa Clara", + "Santa Clara / Muralla de Sant Magí", + "Convent de Santa Clara", + "Convent de Santa Clara", + "Santa Clara del Mullol", + "Plaça de la Mare Santa Clara", + "Pujada de Santa Clara", + "Carrer Nou de Santa Clara" ], + "amenities": [ { "name": "Pastisseria Santa Clara", From a691646c6da79d9828f8367c6bcae74265c2b767 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 22:37:14 +0200 Subject: [PATCH 11/26] Fix tests --- .../net/osmand/search/SearchUICoreTest.java | 39 +- .../src/test/resources/search/starbucks.json | 515 ++++++++++-------- 2 files changed, 304 insertions(+), 250 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 12c469f6e7..6d14532fe6 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -177,25 +177,19 @@ public class SearchUICoreTest { collection.addSearchResults(matcher.getRequestResults(), true, true); List searchResults = collection.getCurrentSearchResults(); int i = 0; + boolean simpleTest = true; for (SearchResult result : searchResults) { String expected = results.get(i++); - String present = result.toString(); - boolean fullFormat = true; - String fmt = fullFormat? "\"%s\", (%d, %s, %.3f, %.2f km)," : "\t\"%s\","; + if(simpleTest && expected.indexOf('[') != -1) { + expected = expected.substring(0, expected.indexOf('[')).trim(); + } +// String present = result.toString(); + String present = formatResult(simpleTest, result, phrase); if (!Algorithms.stringsEqual(expected, present)) { - System.out.println(String.format("Mismatch for '%s' != '%s' (%d, %s, %.3f). Result: ", expected, - present, result.getFoundWordCount(), result.objectType.toString(), - result.getUnknownPhraseMatchWeight())); + System.out.println(String.format("Mismatch for '%s' != '%s'. Result: ", expected, + present)); for (SearchResult r : searchResults) { - double dist = 0; - if(r.location != null) { - dist = MapUtils.getDistance(r.location, phrase.getLastTokenLocation()); - } - System.out.println(String.format(fmt, r.toString(), - r.getFoundWordCount(), r.objectType.toString(), - r.getUnknownPhraseMatchWeight(), - dist / 1000 - )); + System.out.println(String.format("\t\"%s\",", formatResult(simpleTest, r, phrase))); } } Assert.assertEquals(expected, present); @@ -205,6 +199,21 @@ public class SearchUICoreTest { } } + private String formatResult(boolean simpleTest, SearchResult r, SearchPhrase phrase) { + if (simpleTest) { + return r.toString(); + } + double dist = 0; + if(r.location != null) { + dist = MapUtils.getDistance(r.location, phrase.getLastTokenLocation()); + } + return String.format("%s [[%d, %s, %.3f, %.2f km]]", r.toString(), + r.getFoundWordCount(), r.objectType.toString(), + r.getUnknownPhraseMatchWeight(), + dist / 1000 + ); + } + static class TestSearchTranslator implements MapPoiTypes.PoiTranslator { private Map enPhrases; diff --git a/OsmAnd-java/src/test/resources/search/starbucks.json b/OsmAnd-java/src/test/resources/search/starbucks.json index bd4e1f75b9..827cbb1cd0 100644 --- a/OsmAnd-java/src/test/resources/search/starbucks.json +++ b/OsmAnd-java/src/test/resources/search/starbucks.json @@ -11,241 +11,286 @@ }, "phrase": "starbucks coffee", "results": [ - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks coffee", - "STARBUCKS COFFEE", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks Coffee", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks", - "Starbucks Coffee สาขา The X-Place", - "Starbucks" + "Starbucks Coffee [[2, POI, 2.000, 1.74 km]]", + "Starbucks Coffee [[2, POI, 2.000, 3.47 km]]", + "Starbucks Coffee [[2, POI, 2.000, 3.47 km]]", + "Starbucks Coffee [[2, POI, 2.000, 92.61 km]]", + "Starbucks Coffee [[2, POI, 2.000, 92.61 km]]", + "Starbucks [[2, POI, 2.000, 212.95 km]]", + "Starbucks [[2, POI, 2.000, 212.95 km]]", + "Starbucks [[2, POI, 2.000, 263.64 km]]", + "Starbucks [[2, POI, 2.000, 263.65 km]]", + "Starbucks [[2, POI, 2.000, 263.67 km]]", + "Starbucks [[2, POI, 2.000, 263.75 km]]", + "Starbucks [[2, POI, 2.000, 263.75 km]]", + "Starbucks [[2, POI, 2.000, 264.13 km]]", + "Starbucks [[2, POI, 2.000, 264.13 km]]", + "Starbucks Coffee [[2, POI, 2.000, 268.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 268.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 285.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 285.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 285.43 km]]", + "Starbucks Coffee [[2, POI, 2.000, 285.43 km]]", + "Starbucks Coffee [[2, POI, 2.000, 336.54 km]]", + "Starbucks Coffee [[2, POI, 2.000, 336.54 km]]", + "Starbucks Coffee [[2, POI, 2.000, 337.99 km]]", + "Starbucks Coffee [[2, POI, 2.000, 337.99 km]]", + "Starbucks Coffee [[2, POI, 2.000, 374.87 km]]", + "Starbucks Coffee [[2, POI, 2.000, 374.87 km]]", + "Starbucks Coffee [[2, POI, 2.000, 376.98 km]]", + "Starbucks Coffee [[2, POI, 2.000, 376.98 km]]", + "Starbucks Coffee [[2, POI, 2.000, 388.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 388.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 388.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 388.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.07 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.07 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.13 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.13 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.68 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.68 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.91 km]]", + "Starbucks Coffee [[2, POI, 2.000, 389.91 km]]", + "Starbucks Coffee [[2, POI, 2.000, 406.19 km]]", + "Starbucks Coffee [[2, POI, 2.000, 406.19 km]]", + "Starbucks Coffee [[2, POI, 2.000, 416.04 km]]", + "Starbucks Coffee [[2, POI, 2.000, 416.04 km]]", + "Starbucks Coffee [[2, POI, 2.000, 417.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 417.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 435.35 km]]", + "Starbucks Coffee [[2, POI, 2.000, 435.35 km]]", + "Starbucks Coffee [[2, POI, 2.000, 449.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 449.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 454.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 454.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.16 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.16 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.29 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.29 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.45 km]]", + "Starbucks Coffee [[2, POI, 2.000, 458.45 km]]", + "Starbucks Coffee [[2, POI, 2.000, 459.18 km]]", + "Starbucks Coffee [[2, POI, 2.000, 459.18 km]]", + "Starbucks Coffee [[2, POI, 2.000, 461.51 km]]", + "Starbucks Coffee [[2, POI, 2.000, 461.51 km]]", + "Starbucks Coffee [[2, POI, 2.000, 462.03 km]]", + "Starbucks Coffee [[2, POI, 2.000, 462.03 km]]", + "Starbucks Coffee [[2, POI, 2.000, 462.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 462.97 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.01 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.01 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.11 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.11 km]]", + "Starbucks Coffee สาขา The X-Place [[2, POI, 2.000, 464.70 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.75 km]]", + "Starbucks Coffee [[2, POI, 2.000, 464.75 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.93 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.93 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.99 km]]", + "Starbucks Coffee [[2, POI, 2.000, 466.99 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.24 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.24 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.36 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.36 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.58 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.58 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.75 km]]", + "Starbucks Coffee [[2, POI, 2.000, 467.75 km]]", + "Starbucks [[2, POI, 2.000, 468.46 km]]", + "Starbucks [[2, POI, 2.000, 468.46 km]]", + "Starbucks [[2, POI, 2.000, 468.53 km]]", + "Starbucks [[2, POI, 2.000, 468.53 km]]", + "Starbucks Coffee [[2, POI, 2.000, 468.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 468.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 468.95 km]]", + "Starbucks Coffee [[2, POI, 2.000, 468.95 km]]", + "Starbucks [[2, POI, 2.000, 468.96 km]]", + "Starbucks [[2, POI, 2.000, 468.96 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.17 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.17 km]]", + "Starbucks [[2, POI, 2.000, 469.19 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.27 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.27 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.27 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.54 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.54 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 469.55 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.59 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.59 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.70 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.70 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.72 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.72 km]]", + "Starbucks [[2, POI, 2.000, 469.72 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.78 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.78 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.84 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.84 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 469.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.05 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.05 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 470.32 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.35 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.35 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.54 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.54 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 470.57 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 470.64 km]]", + "Starbucks [[2, POI, 2.000, 470.66 km]]", + "Starbucks [[2, POI, 2.000, 470.77 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.83 km]]", + "Starbucks Coffee [[2, POI, 2.000, 470.83 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 470.83 km]]", + "Starbucks [[2, POI, 2.000, 471.00 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.04 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.04 km]]", + "Starbucks [[2, POI, 2.000, 471.06 km]]", + "Starbucks [[2, POI, 2.000, 471.13 km]]", + "Starbucks [[2, POI, 2.000, 471.13 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.15 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.24 km]]", + "Starbucks [[2, POI, 2.000, 471.25 km]]", + "Starbucks [[2, POI, 2.000, 471.26 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.33 km]]", + "Starbucks [[2, POI, 2.000, 471.47 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.59 km]]", + "Starbucks [[2, POI, 2.000, 471.62 km]]", + "Starbucks [[2, POI, 2.000, 471.62 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.66 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.66 km]]", + "Starbucks [[2, POI, 2.000, 471.67 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.69 km]]", + "Starbucks [[2, POI, 2.000, 471.69 km]]", + "Starbucks [[2, POI, 2.000, 471.70 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.75 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.75 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.75 km]]", + "Starbucks [[2, POI, 2.000, 471.75 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.83 km]]", + "Starbucks [[2, POI, 2.000, 471.83 km]]", + "Starbucks [[2, POI, 2.000, 471.84 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.85 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.89 km]]", + "Starbucks [[2, POI, 2.000, 471.89 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.90 km]]", + "Starbucks [[2, POI, 2.000, 471.91 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 471.94 km]]", + "Starbucks Coffee [[2, POI, 2.000, 471.97 km]]", + "Starbucks [[2, POI, 2.000, 472.01 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.03 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.03 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.03 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 472.06 km]]", + "Starbucks [[2, POI, 2.000, 472.17 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.24 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.24 km]]", + "Starbucks [[2, POI, 2.000, 472.32 km]]", + "Starbucks [[2, POI, 2.000, 472.39 km]]", + "Starbucks [[2, POI, 2.000, 472.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.40 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.40 km]]", + "สตาร์บัคส์ [[2, POI, 2.000, 472.45 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.76 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.76 km]]", + "Starbucks [[2, POI, 2.000, 472.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.92 km]]", + "Starbucks Coffee [[2, POI, 2.000, 472.93 km]]", + "Starbucks Coffee [[2, POI, 2.000, 473.14 km]]", + "Starbucks Coffee [[2, POI, 2.000, 473.14 km]]", + "Starbucks Coffee [[2, POI, 2.000, 473.53 km]]", + "Starbucks Coffee [[2, POI, 2.000, 473.53 km]]", + "Starbucks [[2, POI, 2.000, 473.55 km]]", + "Starbucks [[2, POI, 2.000, 474.53 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.60 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.63 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.63 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.73 km]]", + "Starbucks Coffee [[2, POI, 2.000, 474.73 km]]", + "Starbucks [[2, POI, 2.000, 475.43 km]]", + "Starbucks [[2, POI, 2.000, 475.64 km]]", + "Starbucks Coffee [[2, POI, 2.000, 475.68 km]]", + "Starbucks Coffee [[2, POI, 2.000, 475.68 km]]", + "Starbucks Coffee [[2, POI, 2.000, 475.83 km]]", + "Starbucks [[2, POI, 2.000, 476.09 km]]", + "Starbucks Coffee [[2, POI, 2.000, 476.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 476.89 km]]", + "Starbucks Coffee [[2, POI, 2.000, 477.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 477.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.00 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.00 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.29 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.29 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.96 km]]", + "Starbucks Coffee [[2, POI, 2.000, 479.96 km]]", + "Starbucks Coffee [[2, POI, 2.000, 480.08 km]]", + "Starbucks Coffee [[2, POI, 2.000, 480.08 km]]", + "Starbucks Coffee [[2, POI, 2.000, 480.20 km]]", + "Starbucks Coffee [[2, POI, 2.000, 480.20 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.18 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.18 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.20 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.20 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.33 km]]", + "Starbucks Coffee [[2, POI, 2.000, 481.33 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.21 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.55 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.55 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.59 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.59 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.73 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.73 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.80 km]]", + "Starbucks Coffee [[2, POI, 2.000, 482.80 km]]", + "Starbucks Coffee [[2, POI, 2.000, 484.02 km]]", + "Starbucks Coffee [[2, POI, 2.000, 484.02 km]]", + "Starbucks Coffee [[2, POI, 2.000, 486.63 km]]", + "Starbucks Coffee [[2, POI, 2.000, 486.63 km]]", + "Starbucks Coffee [[2, POI, 2.000, 486.83 km]]", + "Starbucks Coffee [[2, POI, 2.000, 486.83 km]]", + "Starbucks Coffee [[2, POI, 2.000, 487.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 487.90 km]]", + "Starbucks Coffee [[2, POI, 2.000, 488.50 km]]", + "Starbucks Coffee [[2, POI, 2.000, 488.50 km]]", + "Starbucks Coffee [[2, POI, 2.000, 489.17 km]]", + "Starbucks Coffee [[2, POI, 2.000, 489.17 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.48 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.48 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.58 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.62 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.62 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.64 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.64 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.67 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.77 km]]", + "Starbucks Coffee [[2, POI, 2.000, 490.77 km]]", + "Starbucks Coffee [[2, POI, 2.000, 491.42 km]]", + "Starbucks Coffee [[2, POI, 2.000, 491.42 km]]", + "Starbucks Coffee [[2, POI, 2.000, 491.69 km]]", + "Starbucks Coffee [[2, POI, 2.000, 491.69 km]]", + "Starbucks coffee [[2, POI, 2.000, 508.65 km]]", + "STARBUCKS COFFEE [[2, POI, 2.000, 508.65 km]]", + "Starbucks Coffee [[2, POI, 2.000, 537.88 km]]", + "Starbucks Coffee [[2, POI, 2.000, 645.39 km]]", + "Starbucks Coffee [[2, POI, 2.000, 645.39 km]]", + "Starbucks [[2, POI, 2.000, 825.00 km]]", + "Starbucks [[2, POI, 2.000, 924.99 km]]", + "Starbucks [[2, POI, 2.000, 925.57 km]]", + "Starbucks Coffee [[2, POI, 2.000, 972.63 km]]", + "Starbucks Coffee [[2, POI, 2.000, 972.63 km]]" ], "amenities": [ { From 9323c2d0470bde689e8b01127aec7a88b81be203 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 22:46:17 +0200 Subject: [PATCH 12/26] Fix test --- .../net/osmand/search/SearchUICoreTest.java | 4 +- .../search/free_street_portland.json | 538 +++++++++++++++++- 2 files changed, 531 insertions(+), 11 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 6d14532fe6..e3916e019f 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -189,7 +189,7 @@ public class SearchUICoreTest { System.out.println(String.format("Mismatch for '%s' != '%s'. Result: ", expected, present)); for (SearchResult r : searchResults) { - System.out.println(String.format("\t\"%s\",", formatResult(simpleTest, r, phrase))); + System.out.println(String.format("\t\"%s\",", formatResult(false, r, phrase))); } } Assert.assertEquals(expected, present); @@ -201,7 +201,7 @@ public class SearchUICoreTest { private String formatResult(boolean simpleTest, SearchResult r, SearchPhrase phrase) { if (simpleTest) { - return r.toString(); + return r.toString().trim(); } double dist = 0; if(r.location != null) { diff --git a/OsmAnd-java/src/test/resources/search/free_street_portland.json b/OsmAnd-java/src/test/resources/search/free_street_portland.json index d39fbcab43..b809d1f6ab 100644 --- a/OsmAnd-java/src/test/resources/search/free_street_portland.json +++ b/OsmAnd-java/src/test/resources/search/free_street_portland.json @@ -11,17 +11,537 @@ }, "phrase": "48 Free Street Portland", "results": [ - "48.0, ", - "48, Free Street (Downtown), Portland" + "48.0, [[1, PARTIAL_LOCATION, 1.000, 5274.99 km]]", + "48, Free Street (Downtown), Portland [[4, HOUSE, 0.430, 0.09 km]]", + "Free Street (Downtown), Portland [[3, STREET, 3.000, 0.03 km]]", + "Free Street (Ferry Village), South Portland [[3, STREET, 3.000, 1.69 km]]", + "48, Portland Street, North Berwick [[3, HOUSE, 0.430, 54.48 km]]" ], "extra-results": [ - "48, Portland Street, North Berwick", - "Free Street (Downtown), Portland", - "Free Street (Ferry Village), South Portland", - "Portland Street", - "Portland Street (Downtown), Portland", - "Portland Street Pier, South Portland", - "Portland Street, Yarmouth" + "Cross North Street, Portland [[2, STREET, 3.000, 0.06 km]]", + "Cross Street Stairs, Portland [[2, STREET, 3.000, 0.07 km]]", + "Cotton Street, Portland [[2, STREET, 3.000, 0.14 km]]", + "Center Street (Old Port), Portland [[2, STREET, 3.000, 0.17 km]]", + "Temple Street (Downtown), Portland [[2, STREET, 3.000, 0.18 km]]", + "Brown Street (Downtown), Portland [[2, STREET, 3.000, 0.20 km]]", + "South Street (Old Port), Portland [[2, STREET, 3.000, 0.21 km]]", + "Cross Street (Old Port), Portland [[2, STREET, 3.000, 0.24 km]]", + "Exchange Street (Downtown), Portland [[2, STREET, 3.000, 0.25 km]]", + "Union Street (Old Port), Portland [[2, STREET, 3.000, 0.28 km]]", + "Wharf Street (Old Port), Portland [[2, STREET, 3.000, 0.29 km]]", + "Market Street (Old Port), Portland [[2, STREET, 3.000, 0.33 km]]", + "Chestnut Street (Downtown), Portland [[2, STREET, 3.000, 0.35 km]]", + "Casco Street (Downtown), Portland [[2, STREET, 3.000, 0.36 km]]", + "Dana Street (Old Port), Portland [[2, STREET, 3.000, 0.36 km]]", + "Federal West Street, Portland [[2, STREET, 3.000, 0.36 km]]", + "Maple Street (Old Port), Portland [[2, STREET, 3.000, 0.38 km]]", + "Oak Street (Downtown), Portland [[2, STREET, 3.000, 0.38 km]]", + "Shepley Street (Downtown), Portland [[2, STREET, 3.000, 0.38 km]]", + "York Street (Old Port), Portland [[2, STREET, 3.000, 0.38 km]]", + "Cedar Street (Downtown), Portland [[2, STREET, 3.000, 0.39 km]]", + "Moulton Street (Old Port), Portland [[2, STREET, 3.000, 0.41 km]]", + "Silver Street (Old Port), Portland [[2, STREET, 3.000, 0.41 km]]", + "Church Street, Portland [[2, STREET, 3.000, 0.42 km]]", + "Pleasant Street (Downtown), Portland [[2, STREET, 3.000, 0.42 km]]", + "Stone Street (Downtown), Portland [[2, STREET, 3.000, 0.42 km]]", + "Milk Street (Old Port), Portland [[2, STREET, 3.000, 0.42 km]]", + "Central Wharf Street, Portland [[2, STREET, 3.000, 0.46 km]]", + "Chapel Street, Portland [[2, STREET, 3.000, 0.47 km]]", + "Elm Street (Downtown), Portland [[2, STREET, 3.000, 0.47 km]]", + "Parris Street, Portland [[2, STREET, 3.000, 0.49 km]]", + "High Street Court, Portland [[2, STREET, 3.000, 0.49 km]]", + "Gold Street (Old Port), Portland [[2, STREET, 3.000, 0.50 km]]", + "Alder Street (Downtown), Portland [[2, STREET, 3.000, 0.50 km]]", + "Federal Street, Portland [[2, STREET, 3.000, 0.50 km]]", + "Newbury West Street, Portland [[2, STREET, 3.000, 0.50 km]]", + "Myrtle Street (Downtown), Portland [[2, STREET, 3.000, 0.51 km]]", + "High Street (Downtown), Portland [[2, STREET, 3.000, 0.52 km]]", + "Custom House Street, Portland [[2, STREET, 3.000, 0.56 km]]", + "Spring Street Place (Downtown), Portland [[2, STREET, 3.000, 0.58 km]]", + "Wilmot Street, Portland [[2, STREET, 3.000, 0.58 km]]", + "Oxford Street, Portland [[2, STREET, 3.000, 0.59 km]]", + "Franklin Street, Portland [[2, STREET, 3.000, 0.59 km]]", + "Mechanic Street (Downtown), Portland [[2, STREET, 3.000, 0.59 km]]", + "Nye Street (Downtown), Portland [[2, STREET, 3.000, 0.60 km]]", + "Hampshire Street, Portland [[2, STREET, 3.000, 0.61 km]]", + "Middle Street, Portland [[2, STREET, 3.000, 0.61 km]]", + "Portland Street (Downtown), Portland [[2, STREET, 3.000, 0.62 km]]", + "Preble Street (Downtown), Portland [[2, STREET, 3.000, 0.62 km]]", + "Park Street (Downtown), Portland [[2, STREET, 3.000, 0.64 km]]", + "Fore Street, Portland [[2, STREET, 3.000, 0.66 km]]", + "Spring Street (Downtown), Portland [[2, STREET, 3.000, 0.68 km]]", + "Henry Street (Downtown), Portland [[2, STREET, 3.000, 0.69 km]]", + "Lancaster Street, Portland [[2, STREET, 3.000, 0.72 km]]", + "Locust Street, Portland [[2, STREET, 3.000, 0.72 km]]", + "Kennebec Street (Downtown), Portland [[2, STREET, 3.000, 0.72 km]]", + "Commercial Street, Portland [[2, STREET, 3.000, 0.73 km]]", + "Deering Street (Downtown), Portland [[2, STREET, 3.000, 0.73 km]]", + "Newbury Street, Portland [[2, STREET, 3.000, 0.73 km]]", + "Pearl Street, Portland [[2, STREET, 3.000, 0.73 km]]", + "Stetson Street (Downtown), Portland [[2, STREET, 3.000, 0.73 km]]", + "Hanover Street (Downtown), Portland [[2, STREET, 3.000, 0.74 km]]", + "Brattle Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", + "Avon Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", + "Grant Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", + "India Street, Portland [[2, STREET, 3.000, 0.76 km]]", + "Sherman Street (Downtown), Portland [[2, STREET, 3.000, 0.77 km]]", + "Congress Street, Portland [[2, STREET, 3.000, 0.77 km]]", + "Somerset Street, Portland [[2, STREET, 3.000, 0.79 km]]", + "Boyd Street, Portland [[2, STREET, 3.000, 0.80 km]]", + "Federal East Street, Portland [[2, STREET, 3.000, 0.82 km]]", + "Smith Street, Portland [[2, STREET, 3.000, 0.82 km]]", + "East Oxford Street, Portland [[2, STREET, 3.000, 0.82 km]]", + "Fox Street, Portland [[2, STREET, 3.000, 0.83 km]]", + "Mayo Street, Portland [[2, STREET, 3.000, 0.84 km]]", + "State Street (West End), Portland [[2, STREET, 3.000, 0.86 km]]", + "North Boyd Street Trail, Portland [[2, STREET, 3.000, 0.87 km]]", + "Hancock Street, Portland [[2, STREET, 3.000, 0.87 km]]", + "Montgomery Street (East End), Portland [[2, STREET, 3.000, 0.88 km]]", + "Tyng Street (Downtown), Portland [[2, STREET, 3.000, 0.89 km]]", + "Tate Street, Portland [[2, STREET, 3.000, 0.92 km]]", + "Thames Street, Portland [[2, STREET, 3.000, 0.92 km]]", + "Gray Street (West End), Portland [[2, STREET, 3.000, 0.93 km]]", + "Winter Street (West End), Portland [[2, STREET, 3.000, 0.94 km]]", + "Cleeves Street, Portland [[2, STREET, 3.000, 0.94 km]]", + "Cleeve Street (East End), Portland [[2, STREET, 3.000, 0.96 km]]", + "North Boyd Street, Portland [[2, STREET, 3.000, 0.97 km]]", + "East Lancaster Street, Portland [[2, STREET, 3.000, 0.98 km]]", + "Dow Street (West End), Portland [[2, STREET, 3.000, 0.98 km]]", + "Mountfort Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.00 km]]", + "Ponce Street, Portland [[2, STREET, 3.000, 1.02 km]]", + "Brackett Street (West End), Portland [[2, STREET, 3.000, 1.02 km]]", + "Mellen Street, Portland [[2, STREET, 3.000, 1.05 km]]", + "Summer Street (West End), Portland [[2, STREET, 3.000, 1.05 km]]", + "Pine Street (West End), Portland [[2, STREET, 3.000, 1.05 km]]", + "Diamond Street (East End), Portland [[2, STREET, 3.000, 1.06 km]]", + "Walker Street (West End), Portland [[2, STREET, 3.000, 1.07 km]]", + "Greenleaf Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", + "Everett Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", + "Monroe Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", + "Clark Street (West End), Portland [[2, STREET, 3.000, 1.10 km]]", + "Briggs Street (West End), Portland [[2, STREET, 3.000, 1.12 km]]", + "North Greenleaf Street, Portland [[2, STREET, 3.000, 1.13 km]]", + "Houlton Street (West End), Portland [[2, STREET, 3.000, 1.13 km]]", + "Madison Street (East End), Portland [[2, STREET, 3.000, 1.14 km]]", + "Beach Street (West End), Portland [[2, STREET, 3.000, 1.15 km]]", + "Lewis Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", + "Cushman Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", + "May Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", + "Anderson Street (East End), Portland [[2, STREET, 3.000, 1.17 km]]", + "Sheridan Street (East End), Portland [[2, STREET, 3.000, 1.19 km]]", + "Winthrop Street (East End), Portland [[2, STREET, 3.000, 1.20 km]]", + "Danforth Street (West End), Portland [[2, STREET, 3.000, 1.21 km]]", + "Salem Street (West End), Portland [[2, STREET, 3.000, 1.21 km]]", + "Kellogg Street, Portland [[2, STREET, 3.000, 1.22 km]]", + "Carleton Street (West End), Portland [[2, STREET, 3.000, 1.23 km]]", + "Hammond Street (East End), Portland [[2, STREET, 3.000, 1.24 km]]", + "School Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", + "Marion Street (East End), Portland [[2, STREET, 3.000, 1.25 km]]", + "Bond Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", + "Preble Street Extension, Portland [[2, STREET, 3.000, 1.25 km]]", + "Taylor Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", + "Adams Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.27 km]]", + "Orange Street (West End), Portland [[2, STREET, 3.000, 1.28 km]]", + "Sherbrooke Street, Portland [[2, STREET, 3.000, 1.29 km]]", + "Neal Street (West End), Portland [[2, STREET, 3.000, 1.29 km]]", + "Emery Street (West End), Portland [[2, STREET, 3.000, 1.29 km]]", + "Monument Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.30 km]]", + "Marshall Street (West End), Portland [[2, STREET, 3.000, 1.30 km]]", + "Waterville Street, Portland [[2, STREET, 3.000, 1.32 km]]", + "Hill Street (West End), Portland [[2, STREET, 3.000, 1.34 km]]", + "Ellsworth Street (West End), Portland [[2, STREET, 3.000, 1.34 km]]", + "St Lawrence Street, Portland [[2, STREET, 3.000, 1.35 km]]", + "Cove Street (East End), Portland [[2, STREET, 3.000, 1.36 km]]", + "Spruce Street (West End), Portland [[2, STREET, 3.000, 1.36 km]]", + "West Commercial Street, Portland [[2, STREET, 3.000, 1.37 km]]", + "West Street (West End), Portland [[2, STREET, 3.000, 1.38 km]]", + "Carroll Street (West End), Portland [[2, STREET, 3.000, 1.40 km]]", + "Atlantic Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.41 km]]", + "Russell Street (West End), Portland [[2, STREET, 3.000, 1.42 km]]", + "Wescott Street (West End), Portland [[2, STREET, 3.000, 1.42 km]]", + "Lafayette Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.43 km]]", + "Wilson Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.43 km]]", + "Cove Street stairs, Portland [[2, STREET, 3.000, 1.43 km]]", + "East Cove Street, Portland [[2, STREET, 3.000, 1.43 km]]", + "Portland Street Pier, South Portland [[2, STREET, 3.000, 1.43 km]]", + "Charles Street (West End), Portland [[2, STREET, 3.000, 1.44 km]]", + "Sheridan Street Woonerf, Portland [[2, STREET, 3.000, 1.44 km]]", + "Merrill Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.45 km]]", + "Gould Street (East End), Portland [[2, STREET, 3.000, 1.45 km]]", + "Thomas Street (West End), Portland [[2, STREET, 3.000, 1.46 km]]", + "Storer Street (West End), Portland [[2, STREET, 3.000, 1.46 km]]", + "Crescent Street (West End), Portland [[2, STREET, 3.000, 1.47 km]]", + "Bank Street (Bayside), Portland [[2, STREET, 3.000, 1.47 km]]", + "Durham Street (Oakdale), Portland [[2, STREET, 3.000, 1.47 km]]", + "Bedford Street (Oakdale), Portland [[2, STREET, 3.000, 1.49 km]]", + "Moody Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.49 km]]", + "Weymouth Street (West End), Portland [[2, STREET, 3.000, 1.50 km]]", + "Munjoy Street, Portland [[2, STREET, 3.000, 1.50 km]]", + "North Street (East End), Portland [[2, STREET, 3.000, 1.50 km]]", + "Vaughan Street (West End), Portland [[2, STREET, 3.000, 1.51 km]]", + "Beckett Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.52 km]]", + "Boynton Street (West End), Portland [[2, STREET, 3.000, 1.52 km]]", + "Obrion Street, Portland [[2, STREET, 3.000, 1.52 km]]", + "Front Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.52 km]]", + "Howard Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.52 km]]", + "Fenwick Street, Portland [[2, STREET, 3.000, 1.53 km]]", + "O'Brion Street, Portland [[2, STREET, 3.000, 1.54 km]]", + "Surrenden Street, Portland [[2, STREET, 3.000, 1.54 km]]", + "High Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.54 km]]", + "Clifford Street (West End), Portland [[2, STREET, 3.000, 1.55 km]]", + "Turner Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.56 km]]", + "Willis Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.56 km]]", + "Dyer Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.58 km]]", + "Bramhall Street, Portland [[2, STREET, 3.000, 1.58 km]]", + "Chadwick Street (West End), Portland [[2, STREET, 3.000, 1.58 km]]", + "Vesper Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.59 km]]", + "Fletcher Street (West End), Portland [[2, STREET, 3.000, 1.59 km]]", + "Monroe Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.59 km]]", + "Emerson Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.60 km]]", + "Montreal Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.60 km]]", + "Orchard Street (West End), Portland [[2, STREET, 3.000, 1.61 km]]", + "Forest Street (West End), Portland [[2, STREET, 3.000, 1.63 km]]", + "Paper Street, Portland [[2, STREET, 3.000, 1.63 km]]", + "Gilman Street (West End), Portland [[2, STREET, 3.000, 1.63 km]]", + "Plowman Street, Portland [[2, STREET, 3.000, 1.64 km]]", + "Randall Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.64 km]]", + "Walnut Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", + "Melbourne Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", + "Oak Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.65 km]]", + "Quebec Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", + "Ocean Street Spur, South Portland [[2, STREET, 3.000, 1.66 km]]", + "Morning Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.67 km]]", + "Tukey Street Connector, Portland [[2, STREET, 3.000, 1.68 km]]", + "Jefferson Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.69 km]]", + "A Street (West End), Portland [[2, STREET, 3.000, 1.69 km]]", + "Granite Street (Oakdale), Portland [[2, STREET, 3.000, 1.69 km]]", + "Falmouth Street (Oakdale), Portland [[2, STREET, 3.000, 1.70 km]]", + "North Marriner Street, South Portland [[2, STREET, 3.000, 1.71 km]]", + "Valley Street (West End), Portland [[2, STREET, 3.000, 1.72 km]]", + "A Street, South Portland [[2, STREET, 3.000, 1.73 km]]", + "Ocean Street, South Portland [[2, STREET, 3.000, 1.74 km]]", + "Mosher Street, South Portland [[2, STREET, 3.000, 1.75 km]]", + "Edmund S Muskie Street, South Portland [[2, STREET, 3.000, 1.76 km]]", + "Fessenden Street, Portland [[2, STREET, 3.000, 1.78 km]]", + "C Street (West End), Portland [[2, STREET, 3.000, 1.79 km]]", + "School Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.80 km]]", + "Stanford Street, South Portland [[2, STREET, 3.000, 1.80 km]]", + "Bowdoin Street (West End), Portland [[2, STREET, 3.000, 1.81 km]]", + "B Street (Knightville), South Portland [[2, STREET, 3.000, 1.82 km]]", + "Exeter Street, Portland [[2, STREET, 3.000, 1.83 km]]", + "Preble Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.83 km]]", + "St John Street (West End), Portland [[2, STREET, 3.000, 1.84 km]]", + "Saint John Street (Libbytown), Portland [[2, STREET, 3.000, 1.84 km]]", + "Pierce Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.84 km]]", + "D Street (West End), Portland [[2, STREET, 3.000, 1.86 km]]", + "Deane Street (Oakdale), Portland [[2, STREET, 3.000, 1.86 km]]", + "Pitt Street (Oakdale), Portland [[2, STREET, 3.000, 1.86 km]]", + "2nd Street, South Portland [[2, STREET, 3.000, 1.87 km]]", + "Payson Street, Portland [[2, STREET, 3.000, 1.88 km]]", + "C Street (Knightville), South Portland [[2, STREET, 3.000, 1.92 km]]", + "Roberts Street (Oakdale), Portland [[2, STREET, 3.000, 1.93 km]]", + "Woodmont Street (Oakdale), Portland [[2, STREET, 3.000, 1.94 km]]", + "Hemlock Street (Libbytown), Portland [[2, STREET, 3.000, 1.95 km]]", + "Cutter Street, Portland [[2, STREET, 3.000, 1.95 km]]", + "Maple Street, South Portland [[2, STREET, 3.000, 1.97 km]]", + "D Street (Knightville), South Portland [[2, STREET, 3.000, 1.98 km]]", + "Kincaid Street, South Portland [[2, STREET, 3.000, 2.01 km]]", + "Madison Street (Ferry Village), South Portland [[2, STREET, 3.000, 2.02 km]]", + "Cherry Street (Libbytown), Portland [[2, STREET, 3.000, 2.02 km]]", + "3rd Street, South Portland [[2, STREET, 3.000, 2.02 km]]", + "Kenwood Street, Portland [[2, STREET, 3.000, 2.02 km]]", + "Henley Street, South Portland [[2, STREET, 3.000, 2.03 km]]", + "Pine Street, South Portland [[2, STREET, 3.000, 2.04 km]]", + "Westfield Street (Libbytown), Portland [[2, STREET, 3.000, 2.05 km]]", + "William Street (Oakdale), Portland [[2, STREET, 3.000, 2.05 km]]", + "Roosevelt Street, South Portland [[2, STREET, 3.000, 2.05 km]]", + "Burnham Street (Libbytown), Portland [[2, STREET, 3.000, 2.05 km]]", + "Marston Street (Libbytown), Portland [[2, STREET, 3.000, 2.06 km]]", + "E Street (Knightville), South Portland [[2, STREET, 3.000, 2.08 km]]", + "Dartmouth Street (Oakdale), Portland [[2, STREET, 3.000, 2.08 km]]", + "F Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.08 km]]", + "Q Street, South Portland [[2, STREET, 3.000, 2.10 km]]", + "Freeman Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.10 km]]", + "Lowell Street (Libbytown), Portland [[2, STREET, 3.000, 2.11 km]]", + "Oakdale Street (Oakdale), Portland [[2, STREET, 3.000, 2.12 km]]", + "Sheffield Street, Portland [[2, STREET, 3.000, 2.12 km]]", + "Harriet Street, South Portland [[2, STREET, 3.000, 2.16 km]]", + "Saint James Street (Oakdale), Portland [[2, STREET, 3.000, 2.17 km]]", + "St James Street (Libbytown), Portland [[2, STREET, 3.000, 2.18 km]]", + "Huntress Street, Portland [[2, STREET, 3.000, 2.18 km]]", + "Mussey Street, South Portland [[2, STREET, 3.000, 2.18 km]]", + "Longfellow East Street, Portland [[2, STREET, 3.000, 2.18 km]]", + "Catherine Street, Portland [[2, STREET, 3.000, 2.20 km]]", + "Noyes Street (Oakdale), Portland [[2, STREET, 3.000, 2.21 km]]", + "Marriner Street, South Portland [[2, STREET, 3.000, 2.22 km]]", + "Thomas Street (Knightville), South Portland [[2, STREET, 3.000, 2.23 km]]", + "Margaret Street, South Portland [[2, STREET, 3.000, 2.23 km]]", + "Longfellow Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.23 km]]", + "Belmont Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.23 km]]", + "Mechanic Street (Knightville), South Portland [[2, STREET, 3.000, 2.27 km]]", + "Grand Street, South Portland [[2, STREET, 3.000, 2.28 km]]", + "Frederic Street, Portland [[2, STREET, 3.000, 2.29 km]]", + "Ballard Street (Knightville), South Portland [[2, STREET, 3.000, 2.30 km]]", + "Holwell Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.30 km]]", + "Spring Street, South Portland [[2, STREET, 3.000, 2.30 km]]", + "Market Street (Knightville), South Portland [[2, STREET, 3.000, 2.31 km]]", + "Soule Street, South Portland [[2, STREET, 3.000, 2.31 km]]", + "St John Street (Oakdale), Portland [[2, STREET, 3.000, 2.32 km]]", + "Benjamin W Pickett Street, South Portland [[2, STREET, 3.000, 2.33 km]]", + "Linden Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.34 km]]", + "Palmer Street (Knightville), South Portland [[2, STREET, 3.000, 2.34 km]]", + "Castle Street, South Portland [[2, STREET, 3.000, 2.35 km]]", + "Cobb Street, South Portland [[2, STREET, 3.000, 2.36 km]]", + "Wadsworth Street (Oakdale), Portland [[2, STREET, 3.000, 2.36 km]]", + "Summit Street, South Portland [[2, STREET, 3.000, 2.37 km]]", + "Cottage Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.38 km]]", + "Adams Street (Ferry Village), South Portland [[2, STREET, 3.000, 2.38 km]]", + "Devonshire Street (Oakdale), Portland [[2, STREET, 3.000, 2.41 km]]", + "Douglass Street (Oakdale), Portland [[2, STREET, 3.000, 2.42 km]]", + "Melrose Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.42 km]]", + "Clemons Street, South Portland [[2, STREET, 3.000, 2.43 km]]", + "St George Street (Oakdale), Portland [[2, STREET, 3.000, 2.44 km]]", + "Barstow Street, South Portland [[2, STREET, 3.000, 2.44 km]]", + "Emery Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.46 km]]", + "Saint George Street (Oakdale), Portland [[2, STREET, 3.000, 2.46 km]]", + "North Richland Street, South Portland [[2, STREET, 3.000, 2.49 km]]", + "Broadway Street (Knightville), South Portland [[2, STREET, 3.000, 2.49 km]]", + "Ocean House Street, South Portland [[2, STREET, 3.000, 2.50 km]]", + "Arlington Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.50 km]]", + "Beverly Street, South Portland [[2, STREET, 3.000, 2.50 km]]", + "Sprauge Street, South Portland [[2, STREET, 3.000, 2.51 km]]", + "Hanson Street (Knightville), South Portland [[2, STREET, 3.000, 2.51 km]]", + "Woodfords Street, Portland [[2, STREET, 3.000, 2.53 km]]", + "Pickett Street, South Portland [[2, STREET, 3.000, 2.56 km]]", + "Armory Street (Knightville), South Portland [[2, STREET, 3.000, 2.56 km]]", + "Smith Street (Willard Square), South Portland [[2, STREET, 3.000, 2.58 km]]", + "Bolton Street (Rosemont), Portland [[2, STREET, 3.000, 2.58 km]]", + "Taylor Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.59 km]]", + "Thompson Street (Willard Square), South Portland [[2, STREET, 3.000, 2.60 km]]", + "Buttonwood Street, South Portland [[2, STREET, 3.000, 2.61 km]]", + "Lincoln Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.61 km]]", + "Grace Street Place (Woodfords Corner), Portland [[2, STREET, 3.000, 2.61 km]]", + "6th Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.62 km]]", + "Bates Street (East Deering), Portland [[2, STREET, 3.000, 2.63 km]]", + "Pearl Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.63 km]]", + "Bowers Street, South Portland [[2, STREET, 3.000, 2.64 km]]", + "Ashmont Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.65 km]]", + "Grace Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.66 km]]", + "Beach Street (Willard Square), South Portland [[2, STREET, 3.000, 2.66 km]]", + "Elm Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.66 km]]", + "Revere Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.66 km]]", + "Emmons Street, Portland [[2, STREET, 3.000, 2.66 km]]", + "Jordan Street (East Deering), Portland [[2, STREET, 3.000, 2.67 km]]", + "Coyle Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.68 km]]", + "Chestnut Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.68 km]]", + "Walnut Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.68 km]]", + "Orland Street, Portland [[2, STREET, 3.000, 2.69 km]]", + "O'Neil Street, South Portland [[2, STREET, 3.000, 2.69 km]]", + "Galvin Street, Portland [[2, STREET, 3.000, 2.69 km]]", + "Lowell Street (Willard Square), South Portland [[2, STREET, 3.000, 2.69 km]]", + "Chase Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.69 km]]", + "Sewall Street (Rosemont), Portland [[2, STREET, 3.000, 2.70 km]]", + "Vincent Street, South Portland [[2, STREET, 3.000, 2.70 km]]", + "Longfellow West Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.71 km]]", + "Randall Street (East Deering), Portland [[2, STREET, 3.000, 2.72 km]]", + "Codman Street, Portland [[2, STREET, 3.000, 2.73 km]]", + "Mildred Street, South Portland [[2, STREET, 3.000, 2.73 km]]", + "Cooper Street (Knightville), South Portland [[2, STREET, 3.000, 2.73 km]]", + "Alpine Street (Knightville), South Portland [[2, STREET, 3.000, 2.73 km]]", + "Alder Street (Willard Square), South Portland [[2, STREET, 3.000, 2.74 km]]", + "Davis Street (Rosemont), Portland [[2, STREET, 3.000, 2.74 km]]", + "Tanner Street, South Portland [[2, STREET, 3.000, 2.75 km]]", + "Berwick Street (East Deering), Portland [[2, STREET, 3.000, 2.75 km]]", + "Day Street (Willard Square), South Portland [[2, STREET, 3.000, 2.75 km]]", + "Frances Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.75 km]]", + "Hersey Street, Portland [[2, STREET, 3.000, 2.76 km]]", + "W Presumpscot Street W, Portland [[2, STREET, 3.000, 2.76 km]]", + "Chapel Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.76 km]]", + "Deblois Street, Portland [[2, STREET, 3.000, 2.76 km]]", + "Morse Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.76 km]]", + "Hooper Street (Libbytown), Portland [[2, STREET, 3.000, 2.77 km]]", + "Walker Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.77 km]]", + "Scott Street (Rosemont), Portland [[2, STREET, 3.000, 2.79 km]]", + "Illsley Street, Portland [[2, STREET, 3.000, 2.80 km]]", + "Edwards Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.80 km]]", + "Churchill Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", + "Clifton Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.81 km]]", + "Lennox Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", + "Front Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", + "Greeley Street (Rosemont), Portland [[2, STREET, 3.000, 2.82 km]]", + "Chenery Street, Portland [[2, STREET, 3.000, 2.82 km]]", + "Beacon Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.82 km]]", + "Kendall Street (East Deering), Portland [[2, STREET, 3.000, 2.83 km]]", + "Fairmount Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.83 km]]", + "West Presumpscot Street, Portland [[2, STREET, 3.000, 2.83 km]]", + "Scamman Street, South Portland [[2, STREET, 3.000, 2.84 km]]", + "Anthoine Street, South Portland [[2, STREET, 3.000, 2.84 km]]", + "Powsland Street (Rosemont), Portland [[2, STREET, 3.000, 2.85 km]]", + "Bennett Street (Knightville), South Portland [[2, STREET, 3.000, 2.86 km]]", + "George Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.88 km]]", + "Pembroke Street, Portland [[2, STREET, 3.000, 2.88 km]]", + "Mitton Street (Rosemont), Portland [[2, STREET, 3.000, 2.88 km]]", + "Brenton Street, South Portland [[2, STREET, 3.000, 2.88 km]]", + "Chester Street (East Deering), Portland [[2, STREET, 3.000, 2.89 km]]", + "South Richland Street, South Portland [[2, STREET, 3.000, 2.89 km]]", + "Craigie Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.89 km]]", + "Saunders Street, Portland [[2, STREET, 3.000, 2.90 km]]", + "North Kelsey Street, South Portland [[2, STREET, 3.000, 2.91 km]]", + "Austin Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.91 km]]", + "Nevens Street, Portland [[2, STREET, 3.000, 2.91 km]]", + "Sherwood Street (East Deering), Portland [[2, STREET, 3.000, 2.91 km]]", + "Robinson Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.92 km]]", + "Pillsbury Street, South Portland [[2, STREET, 3.000, 2.92 km]]", + "Cedar Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.92 km]]", + "Willow Street (Willard Square), South Portland [[2, STREET, 3.000, 2.93 km]]", + "Carter Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.93 km]]", + "Kensington Street, Portland [[2, STREET, 3.000, 2.93 km]]", + "Cummings Street, Portland [[2, STREET, 3.000, 2.93 km]]", + "Mackworth Street, Portland [[2, STREET, 3.000, 2.94 km]]", + "Kelly Street (Knightville), South Portland [[2, STREET, 3.000, 2.95 km]]", + "Lahave Street, South Portland [[2, STREET, 3.000, 2.95 km]]", + "Richmond Street (East Deering), Portland [[2, STREET, 3.000, 2.95 km]]", + "Bryant Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.96 km]]", + "Pitt Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.96 km]]", + "Mount Vernon Street (Knightville), South Portland [[2, STREET, 3.000, 2.97 km]]", + "Watson Street (East Deering), Portland [[2, STREET, 3.000, 2.97 km]]", + "Lawrence Lano Street, South Portland [[2, STREET, 3.000, 2.98 km]]", + "Norwood Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.98 km]]", + "Savoy Street, Portland [[2, STREET, 3.000, 2.98 km]]", + "Caleb Street (Brighton Corner), Portland [[2, STREET, 3.000, 2.98 km]]", + "Davis Street (Willard Square), South Portland [[2, STREET, 3.000, 2.99 km]]", + "Cole Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.99 km]]", + "Upland Street, Portland [[2, STREET, 3.000, 2.99 km]]", + "Dalton Street (East Deering), Portland [[2, STREET, 3.000, 3.00 km]]", + "Johansen Street, Portland [[2, STREET, 3.000, 3.00 km]]", + "Vivian Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.00 km]]", + "Carroll Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.00 km]]", + "Island Street (East Deering), Portland [[2, STREET, 3.000, 3.00 km]]", + "Highland Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.00 km]]", + "Lassell Street, Portland [[2, STREET, 3.000, 3.00 km]]", + "Willard Street (Willard Square), South Portland [[2, STREET, 3.000, 3.02 km]]", + "Loveitt Street, South Portland [[2, STREET, 3.000, 3.04 km]]", + "Valley Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.04 km]]", + "Sullivan Street (East Deering), Portland [[2, STREET, 3.000, 3.04 km]]", + "Mayberry Street, South Portland [[2, STREET, 3.000, 3.05 km]]", + "Alton Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.05 km]]", + "Rackleff Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.05 km]]", + "Reynolds Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.05 km]]", + "Sawyer Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.06 km]]", + "Hoyt Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.06 km]]", + "Prospect Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.07 km]]", + "Edwards Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.07 km]]", + "Berkeley Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.08 km]]", + "Hodgins Street, Portland [[2, STREET, 3.000, 3.08 km]]", + "Fairfield Street (East Deering), Portland [[2, STREET, 3.000, 3.08 km]]", + "Clinton Street (Willard Square), South Portland [[2, STREET, 3.000, 3.09 km]]", + "Henry Street (Loveitts Field), South Portland [[2, STREET, 3.000, 3.09 km]]", + "Irving Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.10 km]]", + "Hanson Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.11 km]]", + "Orchard Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.12 km]]", + "Fayette Street, Portland [[2, STREET, 3.000, 3.12 km]]", + "Amherst Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.13 km]]", + "Deake Street, South Portland [[2, STREET, 3.000, 3.13 km]]", + "South Kelsey Street, South Portland [[2, STREET, 3.000, 3.13 km]]", + "Hunt Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.13 km]]", + "Mayland Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.14 km]]", + "Simonton Street, South Portland [[2, STREET, 3.000, 3.14 km]]", + "Latham Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.14 km]]", + "Bradley Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.15 km]]", + "Dirigo Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.15 km]]", + "West Kidder Street, Portland [[2, STREET, 3.000, 3.16 km]]", + "Goudy Street, South Portland [[2, STREET, 3.000, 3.16 km]]", + "Sterling Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.17 km]]", + "Mason Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.18 km]]", + "Hamilton Street (Knightville), South Portland [[2, STREET, 3.000, 3.18 km]]", + "Somerset Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.19 km]]", + "Beaufort Street, South Portland [[2, STREET, 3.000, 3.20 km]]", + "Belknap Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.21 km]]", + "Ivy Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.21 km]]", + "Wylie Street, South Portland [[2, STREET, 3.000, 3.21 km]]", + "Charlotte Street (Willard Square), South Portland [[2, STREET, 3.000, 3.21 km]]", + "Veranda Street, Portland [[2, STREET, 3.000, 3.22 km]]", + "Minott Street, South Portland [[2, STREET, 3.000, 3.22 km]]", + "Wayne Street, Portland [[2, STREET, 3.000, 3.23 km]]", + "Dudley Street (East Deering), Portland [[2, STREET, 3.000, 3.23 km]]", + "Fernald Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.24 km]]", + "Bay Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.24 km]]", + "Saint Jude Street, Portland [[2, STREET, 3.000, 3.25 km]]", + "Florence Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.25 km]]", + "Prentiss Street (East Deering), Portland [[2, STREET, 3.000, 3.26 km]]", + "Florence Street (Deering Center), Portland [[2, STREET, 3.000, 3.26 km]]", + "Oakley Street, Portland [[2, STREET, 3.000, 3.26 km]]", + "Dunscombe Street, South Portland [[2, STREET, 3.000, 3.27 km]]", + "Fairview Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.28 km]]", + "Morse Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.28 km]]", + "Lincoln Street (Ligonia), South Portland [[2, STREET, 3.000, 3.28 km]]", + "Saint Street, Portland [[2, STREET, 3.000, 3.28 km]]", + "Linwood Street, South Portland [[2, STREET, 3.000, 3.30 km]]", + "St Jude Street, Portland [[2, STREET, 3.000, 3.30 km]]", + "Arcadia Street, Portland [[2, STREET, 3.000, 3.31 km]]", + "Burnham Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.31 km]]", + "Jackson Street (Ligonia), South Portland [[2, STREET, 3.000, 3.33 km]]", + "Rosedale Street (East Deering), Portland [[2, STREET, 3.000, 3.33 km]]", + "Boody Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.33 km]]", + "Parrott Street, South Portland [[2, STREET, 3.000, 3.34 km]]", + "Frost Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.35 km]]", + "Inverness Street (East Deering), Portland [[2, STREET, 3.000, 3.35 km]]", + "Higgins Street (Deering Center), Portland [[2, STREET, 3.000, 3.35 km]]", + "Hutchinson Street (Ligonia), South Portland [[2, STREET, 3.000, 3.35 km]]", + "Hill Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.35 km]]", + "Hall Street, Portland [[2, STREET, 3.000, 3.36 km]]", + "Orkney Street, Portland [[2, STREET, 3.000, 3.36 km]]", + "Belfield Street, Portland [[2, STREET, 3.000, 3.37 km]]", + "Lombard Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.38 km]]", + "Bodge Street, South Portland [[2, STREET, 3.000, 3.38 km]]", + "Hawthorne Street (East Deering), Portland [[2, STREET, 3.000, 3.38 km]]", + "Tremont Street (Deering Center), Portland [[2, STREET, 3.000, 3.38 km]]", + "Osgood Street, Portland [[2, STREET, 3.000, 3.40 km]]", + "Woodford Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.40 km]]", + "Wordsworth Street, Portland [[2, STREET, 3.000, 3.41 km]]", + "Curtis Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.41 km]]", + "Whittier Street (East Deering), Portland [[2, STREET, 3.000, 3.41 km]]", + "Loraine Street, Portland [[2, STREET, 3.000, 3.42 km]]", + "Chandler Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.42 km]]", + "Concord Street (Deering Center), Portland [[2, STREET, 3.000, 3.42 km]]", + "Gately Street, South Portland [[2, STREET, 3.000, 3.43 km]]", + "James Street (Deering Center), Portland [[2, STREET, 3.000, 3.44 km]]", + "Woodbury Street (Loveitts Field), South Portland [[2, STREET, 3.000, 3.44 km]]", + "Billy Vachon Street, South Portland [[2, STREET, 3.000, 3.47 km]]", + "June Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.47 km]]", + "Chapman Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.48 km]]", + "Caribou Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.48 km]]", + "Read Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.48 km]]", + "Matthews Street (Deering Center), Portland [[2, STREET, 3.000, 3.49 km]]", + "Motley Street (Rosemont), Portland [[2, STREET, 3.000, 3.50 km]]", + "Harding Street (Ligonia), South Portland [[2, STREET, 3.000, 3.50 km]]", + "Fenway Street, Portland [[2, STREET, 3.000, 3.51 km]]", + "Kineo Street, Portland [[2, STREET, 3.000, 3.51 km]]", + "Victoria Street (East Deering), Portland [[2, STREET, 3.000, 3.52 km]]", + "Frye Street, Portland [[2, STREET, 3.000, 3.52 km]]", + "East Kidder Street (East Deering), Portland [[2, STREET, 3.000, 3.52 km]]", + "Bay Street Extension, Portland [[2, STREET, 3.000, 3.52 km]]", + "Torrey Street, Portland [[2, STREET, 3.000, 3.52 km]]", + "Haywood Street, Portland [[2, STREET, 3.000, 3.53 km]]", + "Runnells Street (Rosemont), Portland [[2, STREET, 3.000, 3.54 km]]", + "Cranston Street, Portland [[2, STREET, 3.000, 3.54 km]]", + "Lake Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.54 km]]", + "Marlow Street, Portland [[2, STREET, 3.000, 3.55 km]]", + "Alton Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.56 km]]", + "Kenilworth Street, Portland [[2, STREET, 3.000, 3.57 km]]", + "Vera Street, Portland [[2, STREET, 3.000, 3.58 km]]", + "Oregon Street, Portland [[2, STREET, 3.000, 3.58 km]]", + "South Grafton Street, Portland [[2, STREET, 3.000, 3.59 km]]", + "Cox Street, South Portland [[2, STREET, 3.000, 3.59 km]]", + "Bismark Street, Portland [[2, STREET, 3.000, 3.59 km]]", + "Providence Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.60 km]]", + "Holly Street (Deering Center), Portland [[2, STREET, 3.000, 3.60 km]]", + "Cleveland Street (East Deering), Portland [[2, STREET, 3.000, 3.61 km]]", + "Sawyer Street (Knightville), South Portland [[2, STREET, 3.000, 3.61 km]]", + "Olympia Street, Portland [[2, STREET, 3.000, 3.61 km]]", + "Hartley Street (Deering Center), Portland [[2, STREET, 3.000, 3.61 km]]", + "Fellows Street (Rosemont), Portland [[2, STREET, 3.000, 3.62 km]]", + "Bancroft Street (Rosemont), Portland [[2, STREET, 3.000, 3.62 km]]" ], "amenities": [ { From dd261a4aa514502ce808ab7535112c1705dd25b3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 22:52:32 +0200 Subject: [PATCH 13/26] Fix test --- .../test/resources/search/carrer_de_vic.json | 168 ++++++++++++++++-- 1 file changed, 150 insertions(+), 18 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/carrer_de_vic.json b/OsmAnd-java/src/test/resources/search/carrer_de_vic.json index 83ce2d7810..4f89d6d72e 100644 --- a/OsmAnd-java/src/test/resources/search/carrer_de_vic.json +++ b/OsmAnd-java/src/test/resources/search/carrer_de_vic.json @@ -11,25 +11,157 @@ }, "phrase": "carrer de Vic, Sant Bartomeu del grau", "results": [ - "Carrer de Sant Bartomeu del Grau, Vic", - "Carrer de Vic, Sant Bartomeu del Grau", - "carrer Ponent, Sant Bartomeu del Grau", - "Carrer Pla de l'Oratori, Sant Bartomeu del Grau", - "carrer de Dalt, Sant Bartomeu del Grau", - "Carrer de la Migjorn, Sant Bartomeu del Grau", - "Carrer de la Tramuntana, Sant Bartomeu del Grau", - "Carrer de la Codina (Xalet Mas Reig), Sant Bartomeu del Grau", - "Carrer de Sant Bartomeu, Sant Cugat del Vallès", - "Carretera de Sant Bartomeu del Grau, Muntanyola", - "Carretera de Sant Bartomeu del Grau, Sant Bartomeu del Grau", - "Carretera de Sant Bartomeu, Sant Bartomeu del Grau", - "Carretera de Sant Bartomeu del Grau, Xalet Mas Reig", - "Camí de St. Bartomeu al Sorreig (Xalet Mas Reig), Sant Bartomeu del Grau", - "Carrer Tres Creus, Sant Bartomeu del Grau", - "Carrer del Mig, Sant Bartomeu del Grau", - "carrer Vell, Sant Bartomeu del Grau", - "Carrer Nou, Sant Bartomeu del Grau" + "Carrer de Sant Bartomeu del Grau, Vic [[7, STREET, 3.000, 61.63 km]]", + "Carrer de Vic, Sant Bartomeu del Grau [[7, STREET, 3.000, 64.33 km]]" ], + "extra-results": [ + "carrer Ponent, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.29 km]]", + "Carrer Pla de l'Oratori, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.38 km]]", + "carrer de Dalt, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.44 km]]", + "Carrer de la Migjorn, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.78 km]]", + "Carrer de la Tramuntana, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.83 km]]", + "Carrer de la Codina (Xalet Mas Reig), Sant Bartomeu del Grau [[6, STREET, 3.000, 64.85 km]]", + "Carrer de Sant Bartomeu, Sant Cugat del Vallès [[5, STREET, 3.000, 11.20 km]]", + "Carrer Tres Creus, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.34 km]]", + "Carrer del Mig, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.43 km]]", + "carrer Vell, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.47 km]]", + "Carrer Nou, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.54 km]]", + "Carrer Llevant, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.76 km]]", + "Carrer del Garbí, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.79 km]]", + "Carrer del Gregal, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.80 km]]", + "Carrer del Xaloc, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.90 km]]", + "Túnel de la Fontfreda (Pere-riera), Sant Bartomeu del Grau [[5, STREET, 3.000, 56.61 km]]", + "Eix Transversal C-25 Viaducte de Pere-riera, Sant Bartomeu del Grau [[5, STREET, 3.000, 57.32 km]]", + "Camí de Ca la Burra, Sant Bartomeu del Grau [[5, STREET, 3.000, 57.58 km]]", + "Carretera de Sant Bartomeu del Grau, Muntanyola [[5, STREET, 3.000, 61.03 km]]", + "Carretera de Sant Bartomeu del Grau, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.00 km]]", + "Camí de Sant Genís, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.08 km]]", + "Camí de Rogers, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.60 km]]", + "Carretera de Sant Bartomeu, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.68 km]]", + "Carretera de Sant Bartomeu del Grau, Xalet Mas Reig [[5, STREET, 3.000, 64.71 km]]", + "Camí de St. Bartomeu al Sorreig (Xalet Mas Reig), Sant Bartomeu del Grau [[5, STREET, 3.000, 65.11 km]]", + "Carrer de Sant Bartomeu, Martorell [[4, STREET, 3.000, 6.20 km]]", + "Carrer Bartomeu Garcia i Subirà, Sant Boi de Llobregat [[4, STREET, 3.000, 11.59 km]]", + "Carrer de Sant Bartomeu de la Quadra (les Corts), Barcelona [[4, STREET, 3.000, 12.07 km]]", + "Carrer de Sant Bartomeu (el Raval), Barcelona [[4, STREET, 3.000, 17.67 km]]", + "Carrer de Sant Bartomeu (Sant Antoni de Llefià), Badalona [[4, STREET, 3.000, 20.95 km]]", + "Carrer de Sant Bartomeu (Sitges), Garraf [[4, STREET, 3.000, 24.54 km]]", + "Carrer de Sant Bartomeu, Vallromanes [[4, STREET, 3.000, 29.73 km]]", + "Carrer de Sant Bartomeu, Granollers [[4, STREET, 3.000, 33.57 km]]", + "Carrer de Sant Bartomeu, Igualada [[4, STREET, 3.000, 33.65 km]]", + "Carrer de Sant Bartomeu (Les Escodines), Manresa [[4, STREET, 3.000, 35.11 km]]", + "Carrer de Sant Bartomeu, Navarcles [[4, STREET, 3.000, 37.02 km]]", + "Carrer de Sant Bartomeu, Cabrera de Mar [[4, STREET, 3.000, 38.13 km]]", + "Carrer de Sant Bartomeu, Santa Oliva [[4, STREET, 3.000, 41.03 km]]", + "Carrer de Sant Bartomeu, Masarbonès [[4, STREET, 3.000, 47.72 km]]", + "Carrer de Sant Bartomeu (Masarbonès), Masllorenç [[4, STREET, 3.000, 47.72 km]]", + "Carrer de Sant Bartomeu (els Hostalets de Balenyà), Balenyà [[4, STREET, 3.000, 48.45 km]]", + "Carrer de Sant Bartomeu, Vistabella [[4, STREET, 3.000, 63.26 km]]", + "Carrer de Sant Bartomeu, Mas de Bondia [[4, STREET, 3.000, 67.50 km]]", + "Carrer de Sant Bartomeu (Mas de Bondia), Montornès de Segarra [[4, STREET, 3.000, 67.50 km]]", + "Carrer de Sant Bartomeu, l'Esquirol [[4, STREET, 3.000, 75.82 km]]", + "Carrer de Sant Bartomeu (Les Planes), l'Esquirol [[4, STREET, 3.000, 76.88 km]]", + "Carrer de Sant Bartomeu, Lloret de Mar [[4, STREET, 3.000, 79.60 km]]", + "Carrer de Sant Bartomeu, Coll de Nargó [[4, STREET, 3.000, 99.35 km]]", + "Carrer de Sant Bartomeu, Camallera [[4, STREET, 3.000, 113.48 km]]", + "Carretera de Sant Bartomeu, l'Ametlla del Vallès [[4, STREET, 3.000, 37.92 km]]", + "Camí d'Alboquers (Pere-riera), Sant Bartomeu del Grau [[4, STREET, 3.000, 58.08 km]]", + "Eix Transversal, Sant Bartomeu del Grau [[4, STREET, 3.000, 59.04 km]]", + "GR 3, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.08 km]]", + "Passeig del Grau, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.28 km]]", + "Plaça del Doctor Griera, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.36 km]]", + "Carretera del Cementiri, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.42 km]]", + "Carrer de Sant Bartomeu [[4, POI, 2.000, 37.02 km]]", + "Sant Bartomeu del Grau [[4, POI, 2.000, 64.32 km]]", + "Sant Bartomeu del Grau [[4, POI, 2.000, 64.60 km]]", + "Carrer de Bartomeu Raurell, Gelida [[3, STREET, 3.000, 8.66 km]]", + "Carrer de Bartomeu Bermejo, Esplugues de Llobregat [[3, STREET, 3.000, 11.06 km]]", + "Carrer de Joan Bartomeu, Sabadell [[3, STREET, 3.000, 16.39 km]]", + "Carrer de Bartomeu Amat, Terrassa [[3, STREET, 3.000, 16.73 km]]", + "carrer del Doctor Robert (Bufalà), Badalona [[3, STREET, 3.000, 23.37 km]]", + "Carrer del Doctor Bartomeu Robert, Mollet del Vallès [[3, STREET, 3.000, 24.65 km]]", + "Carrer de Bartomeu Soler, Palau-solità i Plegamans [[3, STREET, 3.000, 25.99 km]]", + "G-06 Sant Bartomeu - Can Planes - Les escletxes, Molins de Rei [[3, STREET, 3.000, 5.65 km]]", + "Carrer Bartomeu, Montornès del Vallès [[3, STREET, 3.000, 28.26 km]]", + "Carrer de Bartomeu Rosselló Porcel, Lliçà de Vall [[3, STREET, 3.000, 28.86 km]]", + "Carrer sant Bartomeu, Òdena [[3, STREET, 3.000, 32.48 km]]", + "Carrer de Bartomeu Serret i Argemi, Granollers [[3, STREET, 3.000, 32.87 km]]", + "Costa de Sant Bartomeu de la Quadra (les Corts), Barcelona [[3, STREET, 3.000, 12.11 km]]", + "carrer del Doctor Bartomeu, Santa Susanna [[3, STREET, 3.000, 65.87 km]]", + "Carrer Sant Bartomeu, Casserres [[3, STREET, 3.000, 66.42 km]]", + "Avinguda de Bartomeu, Cerdanyola del Vallès [[3, STREET, 3.000, 13.29 km]]", + "Carrer Sant Bartomeu, Torelló [[3, STREET, 3.000, 73.57 km]]", + "Carrer Sant Bartomeu, Blanes [[3, STREET, 3.000, 73.61 km]]", + "Carrer Sant Bartomeu, Ripoll [[3, STREET, 3.000, 88.15 km]]", + "Camí de Vilassar de Dalt a Sant Bartomeu, Òrrius [[3, STREET, 3.000, 34.23 km]]", + "Camí de Mas Bartomeu, la Bisbal del Penedès [[3, STREET, 3.000, 39.50 km]]", + "Camí del Coll d'Arca a Mas Bartomeu, Masies de Sansuies [[3, STREET, 3.000, 41.52 km]]", + "Plaça de Sant Bartomeu, Alió [[3, STREET, 3.000, 57.01 km]]", + "Carretera de Sant Bartomeu, Gurb [[3, STREET, 3.000, 61.97 km]]", + "Camí de Sant Julià Sassorba a Sant Bartomeu, Gurb [[3, STREET, 3.000, 62.60 km]]", + "BV-4601 - Carretera de Sant Bartomeu, Gurb [[3, STREET, 3.000, 63.02 km]]", + "Camí d'Olost a la Carretera de Sant Bartomeu, Olost [[3, STREET, 3.000, 63.55 km]]", + "Camí d'Olost a la carretera de Sant Bartomeu, Olost [[3, STREET, 3.000, 67.15 km]]", + "Camí ramader de Sant Bartomeu, Sant Boi de Lluçanès [[3, STREET, 3.000, 68.86 km]]", + "Avinguda de Sant Bartomeu, Solsona [[3, STREET, 3.000, 73.65 km]]", + "Camí de Sant Bartomeu, l'Esquirol [[3, STREET, 3.000, 74.00 km]]", + "Camí de Sant Bartomeu (la Valldan), Berga [[3, STREET, 3.000, 75.54 km]]", + "Camí de Sant Bartomeu, el Tossal [[3, STREET, 3.000, 87.03 km]]", + "Camí de Sant Bartomeu (el Tossal), Ponts [[3, STREET, 3.000, 87.04 km]]", + "Baixada de Sant Bartomeu, Bellmunt d'Urgell [[3, STREET, 3.000, 92.97 km]]", + "Camí de Sant Bartomeu de Matamala, Porqueres [[3, STREET, 3.000, 100.30 km]]", + "Camí de Sant Bartomeu, Fontcoberta [[3, STREET, 3.000, 105.05 km]]", + "Riera de Sant Bartomeu [[3, POI, 2.000, 4.30 km]]", + "Riera de Sant Bartomeu [[3, POI, 2.000, 4.85 km]]", + "Sant Bartomeu de la Quadra [[3, POI, 2.000, 5.92 km]]", + "Sant Bartomeu de la Quadra [[3, POI, 2.000, 5.94 km]]", + "Sant Bartomeu de la Quadra [[3, POI, 2.000, 6.11 km]]", + "Sant Bartomeu de la Quadra [[3, POI, 2.000, 6.11 km]]", + "Parròquia de Sant Bartomeu [[3, POI, 2.000, 15.86 km]]", + "Parròquia de Sant Bartomeu [[3, POI, 2.000, 16.56 km]]", + "Torrent de Sant Bartomeu [[3, POI, 2.000, 34.74 km]]", + "Font de Sant Bartomeu [[3, POI, 2.000, 34.77 km]]", + "Torrent de Sant Bartomeu [[3, POI, 2.000, 34.78 km]]", + "Coll de Sant Bartomeu [[3, POI, 2.000, 34.97 km]]", + "Sant Bartomeu de Cabanyes [[3, POI, 2.000, 34.97 km]]", + "Sant Bartomeu de Navarcles [[3, POI, 2.000, 37.15 km]]", + "Ermita de Sant Bartomeu [[3, POI, 2.000, 37.55 km]]", + "Plana del Mas de Bartomeu [[3, POI, 2.000, 40.31 km]]", + "Esglèsia de Sant Bartomeu [[3, POI, 2.000, 44.70 km]]", + "Esgèsia de Sant Bartomeu [[3, POI, 2.000, 47.71 km]]", + "Sant Bartomeu de Carbasí [[3, POI, 2.000, 49.20 km]]", + "Plaça de Sant Bartomeu [[3, POI, 2.000, 56.99 km]]", + "riera de Sant Bartomeu [[3, POI, 2.000, 59.66 km]]", + "Sant Bartomeu de la Vall de Vilaramó [[3, POI, 2.000, 60.00 km]]", + "St. Bartomeu del Grau / Gurb [[3, POI, 2.000, 61.41 km]]", + "St. Bartomeu del Grau / Gurb [[3, POI, 2.000, 61.74 km]]", + "Carretera de Sant Bartomeu [[3, POI, 2.000, 62.08 km]]", + "Carretera de Sant Bartomeu [[3, POI, 2.000, 62.89 km]]", + "Bac de Sant Bartomeu [[3, POI, 2.000, 73.44 km]]", + "Serrat de Sant Bartomeu [[3, POI, 2.000, 74.98 km]]", + "Capella de Sant Bartomeu [[3, POI, 2.000, 83.35 km]]", + "Collada de Sant Bartomeu [[3, POI, 2.000, 83.91 km]]", + "Baga de Sant Bartomeu [[3, POI, 2.000, 84.00 km]]", + "Riera de Sant Bartomeu [[3, POI, 2.000, 84.24 km]]", + "Sant Bartomeu de Covildases [[3, POI, 2.000, 84.43 km]]", + "Sant Bartomeu de Llaés [[3, POI, 2.000, 84.58 km]]", + "Església de Sant Bartomeu [[3, POI, 2.000, 93.91 km]]", + "Barranc de Sant Bartomeu [[3, POI, 2.000, 95.89 km]]", + "Esglesia de Sant Bartomeu [[3, POI, 2.000, 108.27 km]]", + "Sant Bartomeu del Portell [[3, POI, 2.000, 108.34 km]]", + "Sant Bartomeu de Favà [[3, POI, 2.000, 111.19 km]]", + "Sant Bartomeu de Malgrat [[3, POI, 2.000, 111.67 km]]", + "Baixada de Sant Bartomeu [[3, POI, 2.000, 112.07 km]]", + "Església de Sant Bartomeu [[3, POI, 2.000, 113.41 km]]", + "Sant Bartomeu de Pincaró [[3, POI, 2.000, 117.14 km]]", + "Tossal de Sant Bartomeu [[3, POI, 2.000, 121.97 km]]", + "Roc de Sant Bartomeu [[3, POI, 2.000, 124.93 km]]", + "Serra de Sant Bartomeu [[3, POI, 2.000, 127.07 km]]", + "Sant Bartomeu de Burg [[3, POI, 2.000, 133.20 km]]", + "Ermita de Sant Bartomeu [[3, POI, 2.000, 139.23 km]]", + "Sant Bartomeu de la Quadra, l'Hospitalet de Llobregat [[3, VILLAGE, 1.000, 5.94 km]]" + ], + "amenities": [ { "name": "Collada de Sant Bartomeu", From bbcee5bc1d1d9c90b037735a35750d556186a027 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 22:57:43 +0200 Subject: [PATCH 14/26] Fix test --- .../test/resources/search/navacerrada.json | 121 +++++++++--------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/navacerrada.json b/OsmAnd-java/src/test/resources/search/navacerrada.json index 17c09093e4..5a53d967bd 100644 --- a/OsmAnd-java/src/test/resources/search/navacerrada.json +++ b/OsmAnd-java/src/test/resources/search/navacerrada.json @@ -11,69 +11,68 @@ }, "phrase": "Calle de las eras 5, Navacerrada", "results": [ - "5, Calle de las Eras (Uranización Los Corales), Navacerrada" + "5, Calle de las Eras (Uranización Los Corales), Navacerrada [[6, HOUSE, 0.430, 70.17 km]]", + "Calle de las Eras (Uranización Los Corales), Navacerrada [[5, STREET, 3.000, 70.15 km]]", + "Calle del Sotillo (Uranización Los Corales), Pasaje de las Eras (Uranización Los Corales), Navacerrada [[5, STREET_INTERSECTION, 0.430, 70.23 km]]", ], "extra-results": [ - "Calle de las Eras (Uranización Los Corales), Navacerrada", - "Calle del Sotillo (Uranización Los Corales), Pasaje de las Eras (Uranización Los Corales), Navacerrada", - "Calle del Puerto de Navacerrada, Las Nieves", - "5, Calle Navacerrada (Urb. Las Suertes), Las Suertes", - "50, Calle de Francisco Navacerrada, Salamanca", - "52, Calle de Francisco Navacerrada, Salamanca", - "53, Calle de Francisco Navacerrada, Salamanca", - "54, Calle de Francisco Navacerrada, Salamanca", - "55, Calle de Francisco Navacerrada, Salamanca", - "56, Calle de Francisco Navacerrada, Salamanca", - "57, Calle de Francisco Navacerrada, Salamanca", - "58, Calle de Francisco Navacerrada, Salamanca", - "59, Calle de Francisco Navacerrada, Salamanca", - "Pasaje de las Eras (Uranización Los Corales), Navacerrada", - "Calle Barrio de las Peñas, Navacerrada", - "Calle de las Cruces (Residencial Sanabria), Navacerrada", - "Calle de las Escuelas, Navacerrada", - "Calle de las Huertas (Residencial Sanabria), Navacerrada", - "Calle de la Virgen de las Nieves, Puerto de Navacerrada", - "Calle Puerto de Navacerrada, La Poveda", - "Calle del Embalse de Navacerrada, Villa de Vallecas", - "Calle del Puerto de Navacerrada, Puente de Vallecas", - "Calle de Francisco Navacerrada, Salamanca", - "Calle de Navacerrada, Moraleja de Enmedio", - "Calle Navacerrada (Urb. Las Suertes), Las Suertes", - "Calle Puerto de Navacerrada, Roman Candelas", - "Calle Navacerrada, Becerril de la Sierra", - "Carretera de Collado Villalba a Navacerrada, El Baillo y las Hojarascas", - "Calle de Ángel Rojas, Navacerrada", - "Calle de los Robles (Uranización Los Corales), Navacerrada", - "Calle de los Enebros (Uranización Los Corales), Navacerrada", - "Calle de la Bola del Mundo (Residencial Sanabria), Navacerrada", - "Calle de la Maliciosa (Residencial Sanabria), Navacerrada", - "Calle de la Perdiz, Navacerrada", - "Calle de la Magdalena, Navacerrada", - "Calle las Jaras, Navacerrada", - "Calle de la Audiencia, Navacerrada", - "Calle de Prado Jerez, Navacerrada", - "Calle de Carmen Conde (Residencial Sanabria), Navacerrada", - "Calle de la Iglesia, Navacerrada", - "Calle de la Tejera, Navacerrada", - "Calle de la Encinilla, Navacerrada", - "Calle de la Canaleja (Residencial Sanabria), Navacerrada", - "Calle de Rafael Alvarado, Navacerrada", - "Calle de Andrés Segovia, Navacerrada", - "Calle de los Pradillos (Residencial Sanabria), Navacerrada", - "Calle de Abel, Navacerrada", - "Calle Praderas de San Sebastián, Navacerrada", - "Calle de San Sebastián (Residencial Sanabria), Navacerrada", - "Calle de Álvaro Iglesia, Navacerrada", - "Calle de los Arcos, Navacerrada", - "Calle de Peñalara, Puerto de Navacerrada", - "Calle de la Bola del Mundo, Puerto de Navacerrada", - "Calle de la Estación, Puerto de Navacerrada", - "Calle Ginos, Puerto de Navacerrada", - "Calle Vitoria, Puerto de Navacerrada", - "Calle Dos Castillas, Puerto de Navacerrada", - "Travesía de las Huertas, Navacerrada", - "Vereda de las Encinillas, Navacerrada", - "Centro Municipal de Mayores «Navacerrada»" + "Calle del Puerto de Navacerrada, Las Nieves [[4, STREET, 3.000, 33.80 km]]", + "Calle Barrio de las Peñas, Navacerrada [[4, STREET, 3.000, 70.10 km]]", + "Calle de las Cruces (Residencial Sanabria), Navacerrada [[4, STREET, 3.000, 70.14 km]]", + "Calle de las Escuelas, Navacerrada [[4, STREET, 3.000, 70.17 km]]", + "Calle de las Huertas (Residencial Sanabria), Navacerrada [[4, STREET, 3.000, 70.18 km]]", + "Calle de la Virgen de las Nieves, Puerto de Navacerrada [[4, STREET, 3.000, 74.59 km]]", + "Pasaje de las Eras (Uranización Los Corales), Navacerrada [[4, STREET, 3.000, 70.23 km]]", + "5, Calle Navacerrada (Urb. Las Suertes), Las Suertes [[4, HOUSE, 0.430, 60.50 km]]", + "50, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.37 km]]", + "52, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.36 km]]", + "53, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.38 km]]", + "54, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.36 km]]", + "55, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.38 km]]", + "56, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.36 km]]", + "57, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.37 km]]", + "58, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.35 km]]", + "59, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.35 km]]", + "Calle Puerto de Navacerrada, La Poveda [[3, STREET, 3.000, 11.22 km]]", + "Calle del Embalse de Navacerrada, Villa de Vallecas [[3, STREET, 3.000, 17.17 km]]", + "Calle del Puerto de Navacerrada, Puente de Vallecas [[3, STREET, 3.000, 22.95 km]]", + "Calle de Francisco Navacerrada, Salamanca [[3, STREET, 3.000, 26.39 km]]", + "Calle de Navacerrada, Moraleja de Enmedio [[3, STREET, 3.000, 29.38 km]]", + "Calle Navacerrada (Urb. Las Suertes), Las Suertes [[3, STREET, 3.000, 60.58 km]]", + "Calle Puerto de Navacerrada, Roman Candelas [[3, STREET, 3.000, 62.20 km]]", + "Calle Navacerrada, Becerril de la Sierra [[3, STREET, 3.000, 67.77 km]]", + "Calle de Ángel Rojas, Navacerrada [[3, STREET, 3.000, 69.64 km]]", + "Calle de los Robles (Uranización Los Corales), Navacerrada [[3, STREET, 3.000, 69.84 km]]", + "Calle de los Enebros (Uranización Los Corales), Navacerrada [[3, STREET, 3.000, 69.90 km]]", + "Calle de la Bola del Mundo (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 69.92 km]]", + "Calle de la Maliciosa (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 69.96 km]]", + "Calle de la Perdiz, Navacerrada [[3, STREET, 3.000, 70.03 km]]", + "Calle de la Magdalena, Navacerrada [[3, STREET, 3.000, 70.08 km]]", + "Calle las Jaras, Navacerrada [[3, STREET, 3.000, 70.12 km]]", + "Calle de la Audiencia, Navacerrada [[3, STREET, 3.000, 70.16 km]]", + "Calle de Prado Jerez, Navacerrada [[3, STREET, 3.000, 70.19 km]]", + "Calle de Carmen Conde (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.23 km]]", + "Calle de la Iglesia, Navacerrada [[3, STREET, 3.000, 70.24 km]]", + "Calle de la Tejera, Navacerrada [[3, STREET, 3.000, 70.27 km]]", + "Calle de la Encinilla, Navacerrada [[3, STREET, 3.000, 70.30 km]]", + "Calle de la Canaleja (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.32 km]]", + "Calle de Rafael Alvarado, Navacerrada [[3, STREET, 3.000, 70.33 km]]", + "Calle de Andrés Segovia, Navacerrada [[3, STREET, 3.000, 70.35 km]]", + "Calle de los Pradillos (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.39 km]]", + "Calle de Abel, Navacerrada [[3, STREET, 3.000, 70.42 km]]", + "Calle Praderas de San Sebastián, Navacerrada [[3, STREET, 3.000, 70.44 km]]", + "Calle de San Sebastián (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.57 km]]", + "Calle de Álvaro Iglesia, Navacerrada [[3, STREET, 3.000, 70.58 km]]", + "Calle de los Arcos, Navacerrada [[3, STREET, 3.000, 70.69 km]]", + "Calle de Peñalara, Puerto de Navacerrada [[3, STREET, 3.000, 74.64 km]]", + "Calle de la Bola del Mundo, Puerto de Navacerrada [[3, STREET, 3.000, 74.71 km]]", + "Calle de la Estación, Puerto de Navacerrada [[3, STREET, 3.000, 74.73 km]]", + "Calle Ginos, Puerto de Navacerrada [[3, STREET, 3.000, 74.76 km]]", + "Calle Vitoria, Puerto de Navacerrada [[3, STREET, 3.000, 74.77 km]]", + "Calle Dos Castillas, Puerto de Navacerrada [[3, STREET, 3.000, 74.96 km]]", + "Travesía de las Huertas, Navacerrada [[3, STREET, 3.000, 70.12 km]]", + "Carretera de Collado Villalba a Navacerrada, El Baillo y las Hojarascas [[3, STREET, 3.000, 72.83 km]]", + "Vereda de las Encinillas, Navacerrada [[3, STREET, 3.000, 75.21 km]]", ], "amenities": [ { From 823506103a94a718dcdf109bfc514869a384fd12 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 2 Jun 2020 23:00:40 +0200 Subject: [PATCH 15/26] Fix test --- .../resources/search/100_bridge_street.json | 65 +++++++++++++++++-- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/100_bridge_street.json b/OsmAnd-java/src/test/resources/search/100_bridge_street.json index 84d7b0bc66..de40be7421 100644 --- a/OsmAnd-java/src/test/resources/search/100_bridge_street.json +++ b/OsmAnd-java/src/test/resources/search/100_bridge_street.json @@ -11,12 +11,65 @@ }, "phrase": "100 Bridge Street", "results": [ - "100.0, ", - "100, Bridge Street, Westbrook", - "100, Bridge Street, Yarmouth", - "Bridge Street", - "Bridge Street Dam", - "Bridge Street" + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", + "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + ], + "extra-results" : [ + "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Westbrook [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", + "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", + "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", + "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", + "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", + "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", + "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", + "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", + "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", + "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", + "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", + "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", + "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", + "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", + "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", + "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", + "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", + "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", + "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", + "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", + "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", + "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]", + "Bridge Street [[2, POI, 2.000, 11.59 km]]", + "Bridge Street Dam [[2, POI, 2.000, 23.62 km]]", + "Bridge Street [[2, POI, 2.000, 27.24 km]]", + "Bridge Street [[2, POI, 2.000, 34.36 km]]", + "Bridge Street [[2, POI, 2.000, 41.33 km]]", + "Bridge Street Dam [[2, POI, 2.000, 41.35 km]]", + "Bridge Street [[2, POI, 2.000, 43.84 km]]", + "Bridge Street [[2, POI, 2.000, 76.87 km]]", + "Bridge Street [[2, POI, 2.000, 77.27 km]]", + "Bridge Street [[2, POI, 2.000, 82.37 km]]", + "Bridge Street [[2, POI, 2.000, 88.20 km]]", + "The Bridge Street Green [[2, POI, 2.000, 104.21 km]]", + "Bridge Street [[2, POI, 2.000, 104.29 km]]", + "Bridge Street [[2, POI, 2.000, 110.92 km]]", + "Bridge Street [[2, POI, 2.000, 116.14 km]]", + "Bridge Street [[2, POI, 2.000, 116.20 km]]", + "Bridge Street [[2, POI, 2.000, 116.26 km]]", + "Bridge Street [[2, POI, 2.000, 119.68 km]]", + "Bridge Street [[2, POI, 2.000, 151.84 km]]", + "Bridge Street [[2, POI, 2.000, 224.29 km]]", + "Bridge Street [[2, POI, 2.000, 243.40 km]]", + "Bridge Street [[2, POI, 2.000, 394.32 km]]", + "Bridge Street [[2, POI, 2.000, 415.17 km]]", + "Bridge Street [[2, POI, 2.000, 434.56 km]]", + "Pool Street, Bridge Road, Biddeford [[2, STREET_INTERSECTION, 0.430, 35.32 km]]", + "Beach Street, Bridge Lane, Ogunquit [[2, STREET_INTERSECTION, 0.430, 56.87 km]]" ], "amenities": [ { From 63f9fe8033d826b897f191315a3cf1ef83173249 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Jun 2020 13:32:20 +0200 Subject: [PATCH 16/26] Revert test location --- .../src/test/java/net/osmand/search/SearchUICoreTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index e3916e019f..da64144e4c 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -62,8 +62,8 @@ public class SearchUICoreTest { Map enPhrases = new HashMap<>(); Map phrases = new HashMap<>(); try { - enPhrases = Algorithms.parseStringsXml(new File("src/test/resources/en/phrases.xml")); - //phrases = Algorithms.parseStringsXml(new File("src/test/resources/ru/phrases.xml")); + enPhrases = Algorithms.parseStringsXml(new File("src/test/resources/phrases/en/phrases.xml")); + //phrases = Algorithms.parseStringsXml(new File("src/test/resources/phrases/ru/phrases.xml")); phrases = enPhrases; } catch (IOException e) { e.printStackTrace(); From 5fc0c531dcd12337e7fe8dda5672ae8673e13ae4 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 3 Jun 2020 14:35:28 +0300 Subject: [PATCH 17/26] Fix burger_king results --- .../test/resources/search/burger_king.json | 93 +++++++++++++------ 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/burger_king.json b/OsmAnd-java/src/test/resources/search/burger_king.json index 072dc45481..75fdcadb36 100644 --- a/OsmAnd-java/src/test/resources/search/burger_king.json +++ b/OsmAnd-java/src/test/resources/search/burger_king.json @@ -11,32 +11,73 @@ }, "phrase": "Burger King", "results": [ - "Burger (Cafe / Cafe and restaurant)", - "Burger (Pub / Food)", - "Burger (Bar / Food)", - "Burger (Restaurant / Cafe and restaurant)", - "Burger (Biergarten / Food)", - "Burger (Fast food / Food)", - "Burger King Thiendorf", - "Burger King", - "Burger King", - "Burger King", - "Burger King", - "Burger King", - "Burger King Riesa", - "Burger King", - "Bürger King Chemnitz", - "Burger King Chemnitz", - "Burger King", - "Burger King", - "Burger King", - "Burger King", - "Burger King Glauchau", - "Burger King", - "Burger King", - "Burger King", - "Burger King", - "Burger King" + "Burger (Cafe / Cafe and restaurant) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger (Pub / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger (Bar / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger (Restaurant / Cafe and restaurant) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger (Biergarten / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger (Fast food / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Burger King Thiendorf [[2, POI, 2.000, 46.35 km]]", + "Burger King [[2, POI, 2.000, 46.75 km]]", + "Burger King [[2, POI, 2.000, 57.61 km]]", + "Burger King [[2, POI, 2.000, 58.23 km]]", + "Burger King [[2, POI, 2.000, 59.20 km]]", + "Burger King [[2, POI, 2.000, 66.93 km]]", + "Burger King Riesa [[2, POI, 2.000, 78.15 km]]", + "Burger King [[2, POI, 2.000, 118.29 km]]", + "Bürger King Chemnitz [[2, POI, 2.000, 121.13 km]]", + "Burger King Chemnitz [[2, POI, 2.000, 123.17 km]]", + "Burger King [[2, POI, 2.000, 135.11 km]]", + "Burger King [[2, POI, 2.000, 139.54 km]]", + "Burger King [[2, POI, 2.000, 139.98 km]]", + "Burger King [[2, POI, 2.000, 140.17 km]]", + "Burger King Glauchau [[2, POI, 2.000, 142.15 km]]", + "Burger King [[2, POI, 2.000, 144.43 km]]", + "Burger King [[2, POI, 2.000, 146.38 km]]", + "Burger King [[2, POI, 2.000, 147.72 km]]", + "Burger King [[2, POI, 2.000, 148.27 km]]", + "Burger King [[2, POI, 2.000, 151.57 km]]", + "Burger Straße 2, Lohsa - Łaz [[1, STREET, 3.000, 6.55 km]]", + "Burger Straße, Lohsa - Łaz [[1, STREET, 3.000, 6.74 km]]", + "Burger Straße 2 [[1, POI, 2.000, 6.56 km]]", + "Beat’n’Burger [[1, POI, 2.000, 56.07 km]]", + "Burgerclub 13 [[1, POI, 2.000, 56.14 km]]", + "Burgermeister [[1, POI, 2.000, 56.18 km]]", + "Burgerheart [[1, POI, 2.000, 56.28 km]]", + "burgerei [[1, POI, 2.000, 58.04 km]]", + "Rock Burger [[1, POI, 2.000, 58.62 km]]", + "Burgerlich [[1, POI, 2.000, 58.73 km]]", + "Bürger Augenoptik [[1, POI, 2.000, 60.75 km]]", + "Burger-Werk [[1, POI, 2.000, 65.07 km]]", + "Bürger- und Vereinshaus [[1, POI, 2.000, 76.72 km]]", + "Burger Cafe Kultur [[1, POI, 2.000, 92.76 km]]", + "Dr. med. Ulrich Bürger [[1, POI, 2.000, 94.32 km]]", + "Bürger-Schützen-Gilde 1470 Wurzen e.V. [[1, POI, 2.000, 115.91 km]]", + "SUMO Burger [[1, POI, 2.000, 117.31 km]]", + "Photovoltaikanlage Freibad Bürger Energie Drebach eG [[1, POI, 2.000, 122.52 km]]", + "ALFS burger & pizza [[1, POI, 2.000, 126.09 km]]", + "Bürger- und Vereinshaus [[1, POI, 2.000, 129.35 km]]", + "Bürger- und Vereinshaus Rittergut [[1, POI, 2.000, 131.71 km]]", + "Bürger-Schützengesellschaft 1857 Taucha e.V. [[1, POI, 2.000, 133.21 km]]", + "Meyer Burger (Germany) AG [[1, POI, 2.000, 135.57 km]]", + "Bürger- und Familienpark Oelsnitz [[1, POI, 2.000, 138.38 km]]", + "Bürger- und Berggasthaus Scheibenberg [[1, POI, 2.000, 138.63 km]]", + "Max-Bürger-Forschungszentrum [[1, POI, 2.000, 138.92 km]]", + "Peter Pane Burgergrill & Bar [[1, POI, 2.000, 139.96 km]]", + "Prime Burger [[1, POI, 2.000, 140.14 km]]", + "Bistro Burger [[1, POI, 2.000, 140.46 km]]", + "Burgerheart [[1, POI, 2.000, 140.47 km]]", + "Burger Like [[1, POI, 2.000, 140.77 km]]", + "burgerme [[1, POI, 2.000, 141.03 km]]", + "Bistro Burger & Co [[1, POI, 2.000, 141.52 km]]", + "Burger-Amt Adler [[1, POI, 2.000, 143.11 km]]", + "Burger Amt #2 [[1, POI, 2.000, 143.51 km]]", + "Parfümerie Burger [[1, POI, 2.000, 151.50 km]]", + "Parfümerie Burger [[1, POI, 2.000, 153.16 km]]", + "Bürger-Begegnungszentrum [[1, POI, 2.000, 178.53 km]]", + "Burger 25 [[1, POI, 2.000, 186.78 km]]", + "Merkur [[0, POI, 2.000, 58.62 km]]", + "Bahnhof Kurort Kipsdorf [[0, POI, 2.000, 80.96 km]]" ], "amenities": [ { From 1592c4697919dc7ff46ac51a8e0e1ff7af4a77a6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Jun 2020 13:41:50 +0200 Subject: [PATCH 18/26] Improve tests --- .../src/test/resources/search/olc.json | 2 +- .../search/street_komsomolskaya.json | 19 ++- .../resources/search/street_lenina_30.json | 74 +++++++-- .../resources/search/street_rue_emile.json | 146 ++++++++++++++++-- .../resources/search/street_santa_clara.json | 102 ++++++------ 5 files changed, 263 insertions(+), 80 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/olc.json b/OsmAnd-java/src/test/resources/search/olc.json index c4db0630cd..104f132446 100644 --- a/OsmAnd-java/src/test/resources/search/olc.json +++ b/OsmAnd-java/src/test/resources/search/olc.json @@ -11,7 +11,7 @@ }, "phrase": "QHW6+CQ", "results": [ - "55.796062, 37.56194" + "55.796062, 37.56194 [[1, LOCATION, 1.000, 6.52 km]]" ], "cities": [] } \ No newline at end of file diff --git a/OsmAnd-java/src/test/resources/search/street_komsomolskaya.json b/OsmAnd-java/src/test/resources/search/street_komsomolskaya.json index 525aee1b12..a07ea43d06 100644 --- a/OsmAnd-java/src/test/resources/search/street_komsomolskaya.json +++ b/OsmAnd-java/src/test/resources/search/street_komsomolskaya.json @@ -11,13 +11,18 @@ }, "phrase": "комсомольская", "results": [ - "Комсомольская улица, Заинск", - "Комсомольская улица, Чукмарлы", - "Комсомольская улица, Русский Акташ", - "Комсомольская улица, Альметьевск", - "Комсомольская набережная, Набережные Челны", - "Комсомольская улица, Новое Надырово", - "Комсомольская улица, Тарловка" + "Комсомольская улица, Заинск [[1, STREET, 3.000, 0.77 km]]", + "Комсомольская улица, Чукмарлы [[1, STREET, 3.000, 26.83 km]]", + "Комсомольская улица, Русский Акташ [[1, STREET, 3.000, 28.18 km]]", + "Комсомольская улица, Альметьевск [[1, STREET, 3.000, 46.40 km]]", + "Комсомольская набережная, Набережные Челны [[1, STREET, 3.000, 48.55 km]]", + "Комсомольская улица, Новое Надырово [[1, STREET, 3.000, 52.30 km]]", + "Комсомольская улица, Тарловка [[1, STREET, 3.000, 55.76 km]]", + "Комсомольская улица, Мамадыш [[1, STREET, 3.000, 61.75 km]]", + "Комсомольская улица, Кузкеево [[1, STREET, 3.000, 73.57 km]]", + "Комсомольская улица, Актюбинский [[1, STREET, 3.000, 73.90 km]]", + "улица Комсомольская, Малтабарово [[1, STREET, 3.000, 74.71 km]]", + "Комсомольская улица, Карабаш [[1, STREET, 3.000, 75.32 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/street_lenina_30.json b/OsmAnd-java/src/test/resources/search/street_lenina_30.json index 2c510ea1e0..7dfef867f8 100644 --- a/OsmAnd-java/src/test/resources/search/street_lenina_30.json +++ b/OsmAnd-java/src/test/resources/search/street_lenina_30.json @@ -11,15 +11,71 @@ }, "phrase": "ленина 30", "results": [ - "30А, улица Ленина, Заинск", - "30Б, улица Ленина, Заинск", - "30, улица Ленина, Сарманово", - "30, улица Ленина, Большое Афанасово", - "30, улица Ленина, Альметьевск", - "30А, улица Ленина, Альметьевск", - "улица Ленина, Заинск", - "улица Ленина, Аксарино", - "улица Ленина, Светлое Озеро" + "30А, улица Ленина, Заинск [[2, HOUSE, 0.430, 1.33 km]]", + "30Б, улица Ленина, Заинск [[2, HOUSE, 0.430, 1.25 km]]", + "30, улица Ленина, Сарманово [[2, HOUSE, 0.430, 37.20 km]]", + "30, улица Ленина, Большое Афанасово [[2, HOUSE, 0.430, 38.21 km]]", + "30, улица Ленина, Альметьевск [[2, HOUSE, 0.430, 46.58 km]]", + "30А, улица Ленина, Альметьевск [[2, HOUSE, 0.430, 46.52 km]]", + "улица Ленина, Заинск [[1, STREET, 3.000, 0.42 km]]", + "улица Ленина, Аксарино [[1, STREET, 3.000, 8.83 km]]", + "улица Ленина, Светлое Озеро [[1, STREET, 3.000, 11.98 km]]", + "улица Ленина, Старый Токмак [[1, STREET, 3.000, 12.32 km]]", + "улица Ленина, Имянлебаш [[1, STREET, 3.000, 13.62 km]]", + "улица Ленина, Верхняя Уратьма [[1, STREET, 3.000, 16.97 km]]", + "улица Ленина, Красная Кадка [[1, STREET, 3.000, 19.92 km]]", + "улица Ленина, Большие Аты [[1, STREET, 3.000, 20.94 km]]", + "улица Ленина, Бегишево [[1, STREET, 3.000, 22.37 km]]", + "улица Ленина, Туба [[1, STREET, 3.000, 26.21 km]]", + "улица Ленина, Русский Акташ [[1, STREET, 3.000, 27.38 km]]", + "улица Ленина, Шингальчи [[1, STREET, 3.000, 27.74 km]]", + "улица Ленина, Болгар [[1, STREET, 3.000, 29.55 km]]", + "улица Ленина, Петровский Завод [[1, STREET, 3.000, 31.18 km]]", + "улица Ленина, Мусабай-Завод [[1, STREET, 3.000, 35.32 km]]", + "улица Ленина, Сарманово [[1, STREET, 3.000, 36.68 km]]", + "улица Ленина, Большое Афанасово [[1, STREET, 3.000, 38.36 km]]", + "улица Ленина, Старое Клянчино [[1, STREET, 3.000, 38.42 km]]", + "улица Ленина, Подгорный Дрюш [[1, STREET, 3.000, 41.91 km]]", + "Ленина, Альметьевск [[1, STREET, 3.000, 44.87 km]]", + "улица Ленина, Альметьевск [[1, STREET, 3.000, 46.35 km]]", + "улица Ленина, Старые Челны [[1, STREET, 3.000, 49.78 km]]", + "улица Ленина, Набережные Челны [[1, STREET, 3.000, 49.78 km]]", + "улица Ленина, Маметьево [[1, STREET, 3.000, 52.24 km]]", + "улица Ленина, Кармалы [[1, STREET, 3.000, 52.25 km]]", + "улица Ленина, Орловка [[1, STREET, 3.000, 53.37 km]]", + "улица Ленина, Буденовец [[1, STREET, 3.000, 54.44 km]]", + "улица Ленина, Джалиль [[1, STREET, 3.000, 54.97 km]]", + "улица Ленина, Чупаево [[1, STREET, 3.000, 55.17 km]]", + "улица Ленина, Новошешминск [[1, STREET, 3.000, 55.87 km]]", + "улица Ленина, Саклов-Баш [[1, STREET, 3.000, 56.28 km]]", + "улица В. И. Ленина, Мамадыш [[1, STREET, 3.000, 60.36 km]]", + "улица Ленина, Красная Горка [[1, STREET, 3.000, 61.68 km]]", + "улица Ленина, Малая Шильна [[1, STREET, 3.000, 66.26 km]]", + "улица Ленина, Актюбинский [[1, STREET, 3.000, 73.22 km]]", + "улица Ленина, Карабаш [[1, STREET, 3.000, 75.67 km]]", + "совхоза имени Ленина [[1, POI, 2.000, 899.76 km]]", + "Леніна [[1, POI, 2.000, 1163.27 km]]", + "улица Ленина [[1, POI, 2.000, 16.46 km]]", + "улица Ленина [[1, POI, 2.000, 27.74 km]]", + "улица Ленина [[1, POI, 2.000, 46.74 km]]", + "улица Ленина [[1, POI, 2.000, 46.74 km]]", + "Ул Ленина [[1, POI, 2.000, 74.29 km]]", + "улица Ленина [[1, POI, 2.000, 108.41 km]]", + "улица Ленина [[1, POI, 2.000, 120.26 km]]", + "Парк Ленина [[1, POI, 2.000, 122.09 km]]", + "улица Ленина [[1, POI, 2.000, 130.70 km]]", + "улица Ленина [[1, POI, 2.000, 138.27 km]]", + "улица Ленина [[1, POI, 2.000, 149.67 km]]", + "Ленина 148 [[1, POI, 2.000, 161.65 km]]", + "Дом-музей В.И.Ленина [[1, POI, 2.000, 188.81 km]]", + "Культурно-досуговый комплекс им. В.И.Ленина [[1, POI, 2.000, 194.07 km]]", + "ДК им.Ленина [[1, POI, 2.000, 194.10 km]]", + "ДК им.Ленина [[1, POI, 2.000, 194.16 km]]", + "НПО им. Ленина [[1, POI, 2.000, 207.90 km]]", + "НПО им. Ленина [[1, POI, 2.000, 207.94 km]]", + "Ленина [[1, POI, 2.000, 218.83 km]]", + "улица Ленина [[1, POI, 2.000, 230.77 km]]", + "Санаторий имени В.И. Ленина [[1, POI, 2.000, 242.65 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/street_rue_emile.json b/OsmAnd-java/src/test/resources/search/street_rue_emile.json index 74c6541b34..c233d6f1fe 100644 --- a/OsmAnd-java/src/test/resources/search/street_rue_emile.json +++ b/OsmAnd-java/src/test/resources/search/street_rue_emile.json @@ -11,18 +11,140 @@ }, "phrase": "rue émile", "results": [ - "Rue Émile Gérard, Liège", - "Rue Emile Vandervelde, Liège", - "Rue Emile Vandervelde - Rue Sainte-Marguerite, Liège", - "Rue Émile Zola (Laveu), Liège", - "Rue Émile Collard, Liège", - "Rue Emile Vandervelde, Vottem", - "Rue Emile Vandervelde (Vottem), Herstal", - "Rue Émile Verhaeren, Liège", - "Rue Émile Jeanne, Saint-Nicolas", - "Rue Emile Muraille, Herstal", - "Rue Emile Verhaeren, Grâce-Hollogne", - "Rue Emile Vinck, Herstal" + "Rue Émile Gérard, Liège [[2, STREET, 3.000, 1.42 km]]", + "Rue Emile Vandervelde, Liège [[2, STREET, 3.000, 1.66 km]]", + "Rue Emile Vandervelde - Rue Sainte-Marguerite, Liège [[2, STREET, 3.000, 1.74 km]]", + "Rue Émile Zola (Laveu), Liège [[2, STREET, 3.000, 1.98 km]]", + "Rue Émile Collard, Liège [[2, STREET, 3.000, 2.49 km]]", + "Rue Emile Vandervelde, Vottem [[2, STREET, 3.000, 3.22 km]]", + "Rue Emile Vandervelde (Vottem), Herstal [[2, STREET, 3.000, 3.23 km]]", + "Rue Émile Verhaeren, Liège [[2, STREET, 3.000, 3.58 km]]", + "Rue Émile Jeanne, Saint-Nicolas [[2, STREET, 3.000, 4.03 km]]", + "Rue Emile Muraille, Herstal [[2, STREET, 3.000, 4.70 km]]", + "Rue Emile Verhaeren, Grâce-Hollogne [[2, STREET, 3.000, 4.71 km]]", + "Rue Emile Vinck, Herstal [[2, STREET, 3.000, 4.72 km]]", + "Rue Emile Wiket, Grâce-Hollogne [[2, STREET, 3.000, 4.74 km]]", + "Rue Émile Zola, Grâce-Berleur [[2, STREET, 3.000, 5.15 km]]", + "Rue Émile Zola (Grâce-Berleur), Grâce-Hollogne [[2, STREET, 3.000, 5.15 km]]", + "Rue Emile Vandervelde (Loncin), Ans [[2, STREET, 3.000, 5.17 km]]", + "Rue Emile Tilman, Herstal [[2, STREET, 3.000, 5.19 km]]", + "Rue Émile Lerousseau, Liers [[2, STREET, 3.000, 5.45 km]]", + "Rue du Couvent - Rue Emile Vandervelde, Liège [[2, STREET, 3.000, 5.74 km]]", + "Rue Émile Lerousseau (Liers), Herstal [[2, STREET, 3.000, 5.85 km]]", + "Rue Émile Vandervelde (Vaux-sous-Chèvremont), Chaudfontaine [[2, STREET, 3.000, 6.60 km]]", + "Rue Emile Royer (Jemeppe-Sur-Meuse), Seraing [[2, STREET, 3.000, 6.76 km]]", + "Rue Emile Vandervelde, Queue-du-Bois [[2, STREET, 3.000, 7.32 km]]", + "Rue Paul Emile Janson, Awans [[2, STREET, 3.000, 7.33 km]]", + "Rue Emile Vandevelde, Fléron [[2, STREET, 3.000, 7.52 km]]", + "Rue Paul-Emile Janson, Flémalle [[2, STREET, 3.000, 8.25 km]]", + "Rue Emile Vandervelde (Vivegnis), Oupeye [[2, STREET, 3.000, 8.34 km]]", + "Rue Emile Vinck, Oupeye [[2, STREET, 3.000, 8.53 km]]", + "Rue Emile Vandervelde, Flémalle [[2, STREET, 3.000, 8.67 km]]", + "Rue Émile Zola, Seraing [[2, STREET, 3.000, 8.76 km]]", + "Rue Emile de Laveleye, Hermalle-sous-Argenteau [[2, STREET, 3.000, 9.67 km]]", + "Rue Emile de Laveleye, Oupeye [[2, STREET, 3.000, 9.84 km]]", + "Rue Emile Grisard, Juprelle [[2, STREET, 3.000, 10.19 km]]", + "Rue Emile Verhaeren, Visé [[2, STREET, 3.000, 13.02 km]]", + "Rue Emile Delcour, Saint-Georges-sur-Meuse [[2, STREET, 3.000, 14.96 km]]", + "Rue Émile Fairon, Pepinster [[2, STREET, 3.000, 18.91 km]]", + "Rue Emile Vandervelde, Comblain-au-Pont [[2, STREET, 3.000, 19.17 km]]", + "Rue Emile Vandervelde (Wegnez), Pepinster [[2, STREET, 3.000, 19.34 km]]", + "Rue Emile Vandervelde, Amay [[2, STREET, 3.000, 20.84 km]]", + "Rue Emile Lelarge, Verviers [[2, STREET, 3.000, 22.80 km]]", + "Rue Émile Vandervelde, Borlez [[2, STREET, 3.000, 23.23 km]]", + "Rue Emile Hallet, Waremme [[2, STREET, 3.000, 23.40 km]]", + "Rue Docteur Emile Neuville, Villers-le-Bouillet [[2, STREET, 3.000, 23.80 km]]", + "Rue Emile Marchoul, Waremme [[2, STREET, 3.000, 24.21 km]]", + "Rue Emile Vandervelde (Vinalmont), Wanze [[2, STREET, 3.000, 25.91 km]]", + "Rue Émile Colette, Limbourg [[2, STREET, 3.000, 25.94 km]]", + "Rue Emile Vandervelde, Vinalmont [[2, STREET, 3.000, 25.97 km]]", + "Rue Émile Muselle, Berloz [[2, STREET, 3.000, 26.33 km]]", + "Rue Emile Delperée, Huy [[2, STREET, 3.000, 26.70 km]]", + "Rue Emile Rorive, Wanze [[2, STREET, 3.000, 27.17 km]]", + "Rue Emile Lejeune, Geer [[2, STREET, 3.000, 28.34 km]]", + "Rue Emile Schmuck, Baelen [[2, STREET, 3.000, 28.49 km]]", + "Rue Emile Roder, Hannut [[2, STREET, 3.000, 31.34 km]]", + "Rue Emile Vandervelde, Marchin [[2, STREET, 3.000, 31.59 km]]", + "Rue Emile Vandervelde, Gives [[2, STREET, 3.000, 33.42 km]]", + "Rue Emile Vandervelde (Gives), Huy [[2, STREET, 3.000, 33.42 km]]", + "Rue Emile Goedert, Francorchamps [[2, STREET, 3.000, 34.14 km]]", + "Rue Emile Martin, Hannut [[2, STREET, 3.000, 34.89 km]]", + "Rue Emile Godfrind, Andenne [[2, STREET, 3.000, 38.07 km]]", + "Rue Emile Godfrind, Seilles [[2, STREET, 3.000, 38.35 km]]", + "Rue Emile Duchesne, Grand-Hallet [[2, STREET, 3.000, 38.66 km]]", + "Rue Emile Looze (Maret), Orp-Jauche [[2, STREET, 3.000, 41.20 km]]", + "Rue Emile Looze (Pellaines), Lincent [[2, STREET, 3.000, 41.24 km]]", + "Rue Emile Tromme, Vielsalm [[2, STREET, 3.000, 42.94 km]]", + "Rue Emile Landeut, Orp-Jauche [[2, STREET, 3.000, 43.71 km]]", + "Rue Emile Parfonry, Hotton [[2, STREET, 3.000, 43.75 km]]", + "Rue Emile Vandervelde (Namêche), Andenne [[2, STREET, 3.000, 44.87 km]]", + "Rue Emile Dupont, Rendeux [[2, STREET, 3.000, 45.98 km]]", + "Rue Émile Demelenne, Marche-en-Famenne [[2, STREET, 3.000, 48.54 km]]", + "Rue Emile Marnach, Vedrin [[2, STREET, 3.000, 52.19 km]]", + "Rue Emile Masset, Perwez [[2, STREET, 3.000, 53.07 km]]", + "Rue Émile Crebeyck, Perwez [[2, STREET, 3.000, 53.41 km]]", + "Rue Emile de Brabant, Perwez [[2, STREET, 3.000, 53.59 km]]", + "Rue Émile Cuvelier, Namur [[2, STREET, 3.000, 53.92 km]]", + "Rue Emile Melchior, Saint-Servais [[2, STREET, 3.000, 55.31 km]]", + "Rue Emile Herman, Marche-en-Famenne [[2, STREET, 3.000, 56.87 km]]", + "Rue Emile Dessenius, Namur [[2, STREET, 3.000, 57.52 km]]", + "Rue Emile Vandervelde (Flawinne), Namur [[2, STREET, 3.000, 58.18 km]]", + "Rue Emile Vandervelde, Flawinne [[2, STREET, 3.000, 58.18 km]]", + "Rue Emile Mazy (Flawinne), Namur [[2, STREET, 3.000, 58.85 km]]", + "Rue Emile Mazy, Flawinne [[2, STREET, 3.000, 58.85 km]]", + "Rue Emile Mahaux, Bois-de-Villers [[2, STREET, 3.000, 60.14 km]]", + "Rue Emile Mahaux, Profondeville [[2, STREET, 3.000, 60.14 km]]", + "Rue Emile Dewez (Beuzet), Gembloux [[2, STREET, 3.000, 60.65 km]]", + "Rue Emile Mazy (Bois-de-Villers), Profondeville [[2, STREET, 3.000, 61.08 km]]", + "Rue Emile Mazy, Bois-de-Villers [[2, STREET, 3.000, 61.08 km]]", + "Rue Emile Marchal, Isnes [[2, STREET, 3.000, 62.58 km]]", + "Rue Émile Lorent, Floreffe [[2, STREET, 3.000, 62.66 km]]", + "Rue Emile Lessire, Floreffe [[2, STREET, 3.000, 62.67 km]]", + "Rue Emile Vandervelde, Nethen [[2, STREET, 3.000, 64.04 km]]", + "Rue Emile Vandervelde (Nethen), Grez-Doiceau [[2, STREET, 3.000, 64.04 km]]", + "Rue Émile Somville, Grand-Manil [[2, STREET, 3.000, 64.11 km]]", + "Rue Émile Labarre, Ernage [[2, STREET, 3.000, 64.11 km]]", + "Rue Emile Tréfois, Mornimont [[2, STREET, 3.000, 64.86 km]]", + "Rue Emile Tréfois, Jemeppe-sur-Sambre [[2, STREET, 3.000, 64.86 km]]", + "Rue Émile Pirson, Mazy [[2, STREET, 3.000, 65.34 km]]", + "Rue Émile Pirson, Gembloux [[2, STREET, 3.000, 65.34 km]]", + "Rue Emile Wauthy, Dinant [[2, STREET, 3.000, 65.92 km]]", + "Rue Emile Matelart (Saint-Martin), Jemeppe-sur-Sambre [[2, STREET, 3.000, 67.02 km]]", + "Rue Emile Francqui, Corbais [[2, STREET, 3.000, 67.03 km]]", + "Rue Emile Francqui (Corbais), Mont-Saint-Guibert [[2, STREET, 3.000, 67.03 km]]", + "Rue Emile Matelart, Saint-Martin [[2, STREET, 3.000, 67.18 km]]", + "Rue Emile Vandervelde, Ham-sur-Sambre [[2, STREET, 3.000, 67.22 km]]", + "Rue Émile Goes (Biéreau), Louvain-la-Neuve [[2, STREET, 3.000, 67.43 km]]", + "Rue Emile Pirson, Sombreffe [[2, STREET, 3.000, 68.64 km]]", + "Rue Émile Mathéi, Limelette [[2, STREET, 3.000, 70.90 km]]", + "Rue Émile Mathéi, Ottignies-Louvain-la-Neuve [[2, STREET, 3.000, 70.90 km]]", + "Rue Émile Henricot, Court-Saint-Etienne [[2, STREET, 3.000, 70.99 km]]", + "Rue Emile Toussaint, Onhaye [[2, STREET, 3.000, 71.25 km]]", + "Rue Emile Toussaint, Serville [[2, STREET, 3.000, 71.25 km]]", + "Rue Emile Duculot, Sambreville [[2, STREET, 3.000, 72.06 km]]", + "Rue Emile Duculot, Tamines [[2, STREET, 3.000, 72.06 km]]", + "Rue Émile Zola (Keumiée), Sambreville [[2, STREET, 3.000, 72.35 km]]", + "Rue Émile Vandervelde (Ligny), Sombreffe [[2, STREET, 3.000, 72.64 km]]", + "Rue Emile Collard, Onhaye [[2, STREET, 3.000, 73.26 km]]", + "Rue Emile Collard, Anthée [[2, STREET, 3.000, 73.26 km]]", + "Rue Émile Vandervelde (Moignelée), Sambreville [[2, STREET, 3.000, 73.61 km]]", + "Rue Emile Leger, Villers-la-Ville [[2, STREET, 3.000, 74.22 km]]", + "Rue Emile Vandervelde, Fleurus [[2, STREET, 3.000, 74.70 km]]", + "Rue Emile Hautem, Fleurus [[2, STREET, 3.000, 74.81 km]]", + "Rue Emile Hautem, Lambusart [[2, STREET, 3.000, 74.81 km]]", + "rue Emile de Clercq, Mettet [[2, STREET, 3.000, 76.79 km]]", + "Rue Émile Vandervelde (Pironchamps), Farciennes [[2, STREET, 3.000, 77.70 km]]", + "Rue Emile Genard, Gerpinnes [[2, STREET, 3.000, 81.14 km]]", + "Rue Émile Montreuil, Gedinne [[2, STREET, 3.000, 87.18 km]]", + "Rue Émile Montreuil, Rienne [[2, STREET, 3.000, 87.42 km]]", + "Glain Rue Emile Vandervelde [[2, POI, 2.000, 1.81 km]]", + "Rue Emile Vandervelde [[2, POI, 2.000, 2.03 km]]", + "Orp-le-Grand Rue Emile Vandervelde [[2, POI, 2.000, 41.51 km]]", + "Namur Rue Émile Cuvelier [[2, POI, 2.000, 53.85 km]]", + "Soye Rue Émile Lorent 252 [[2, POI, 2.000, 62.77 km]]", + "Soye Rue Émile Lorent 252 [[2, POI, 2.000, 62.81 km]]", + "Rue Émile Pirson [[2, POI, 2.000, 65.74 km]]", + "Fleurus Rue Emile Vandervelde [[2, POI, 2.000, 74.90 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/street_santa_clara.json b/OsmAnd-java/src/test/resources/search/street_santa_clara.json index 45c0c9e276..aeb4e2f2ce 100644 --- a/OsmAnd-java/src/test/resources/search/street_santa_clara.json +++ b/OsmAnd-java/src/test/resources/search/street_santa_clara.json @@ -11,57 +11,57 @@ }, "phrase": "santa clara", "results": [ - "Carrer de Santa Clara, Sant Pol de Mar", - "Santa Clara, Sant Pol de Mar", - "Carrer Santa Clara, Sant Pol de Mar", - "Plaça Santa Clara, Santa Coloma de Farners", - "Carrer del Comte de Santa Clara, Barcelona", - "Carrer del Comte de Santa Clara, la Barceloneta", - "Passatge de Santa Clara, Barcelona", - "Passatge de Santa Clara, Barri Gòtic", - "Baixada de Santa Clara, Barcelona", - "Baixada de Santa Clara, Barri Gòtic", - "Carrer de Santa Clara, Girona", - "Plaça de Santa Clara, Vic", - "Carrer de Santa Clara, Poble Nou", - "Carrer de Santa Clara (Poble Nou), Sant Vicenç dels Horts", - "Carrer Vell de Santa Clara, Manresa", - "Carrer Nou de Santa Clara, Centre Històric", - "Carrer Nou de Santa Clara (Les Escodines), Manresa", - "Carrer de Santa Clara, Masquefa", - "Carrer Santa Clara, Castelló d'Empúries", - "Carrer de Santa Clara, Vilafranca del Penedès", - "Carrer de Santa Clara, Castelló d'Empúries", - "Santa Clara", - "Santa Clara", - "Santa Clara", - "Santa Clara", - "Pastisseria Santa Clara", - "Escola Santa Clara", - "Santa Clara", - "L11 - Santa Clara", - "Santa Clara", - "CAP SANTA CLARA", - "CAP Santa Clara", - "L11 - Santa Clara", - "Plaça de Santa Clara", - "Pl. Santa Clara", - "Santa Clara de Olimar", - "Claverol / Santa Clara", - "Monestir de Santa Clara", - "Santa Clara", - "La Sínia de Santa Clara", - "Restaurant Santa Clara", - "Hostal Santa Clara", - "Santa Maria del Castell de Claramunt", - "Monestir de Santa Clara", - "Santa Clara / Muralla de Sant Magí", - "Convent de Santa Clara", - "Convent de Santa Clara", - "Santa Clara del Mullol", - "Plaça de la Mare Santa Clara", - "Pujada de Santa Clara", - "Carrer Nou de Santa Clara" + "Carrer de Santa Clara, Sant Pol de Mar [[2, STREET, 3.000, 0.03 km]]", + "Santa Clara, Sant Pol de Mar [[2, STREET, 3.000, 0.06 km]]", + "Carrer Santa Clara, Sant Pol de Mar [[2, STREET, 3.000, 0.12 km]]", + "Plaça Santa Clara, Santa Coloma de Farners [[2, STREET, 3.000, 29.76 km]]", + "Carrer del Comte de Santa Clara, Barcelona [[2, STREET, 3.000, 43.84 km]]", + "Carrer del Comte de Santa Clara, la Barceloneta [[2, STREET, 3.000, 43.84 km]]", + "Passatge de Santa Clara, Barcelona [[2, STREET, 3.000, 44.32 km]]", + "Passatge de Santa Clara, Barri Gòtic [[2, STREET, 3.000, 44.32 km]]", + "Baixada de Santa Clara, Barcelona [[2, STREET, 3.000, 44.33 km]]", + "Baixada de Santa Clara, Barri Gòtic [[2, STREET, 3.000, 44.33 km]]", + "Carrer de Santa Clara, Girona [[2, STREET, 3.000, 45.73 km]]", + "Plaça de Santa Clara, Vic [[2, STREET, 3.000, 47.62 km]]", + "Carrer de Santa Clara, Poble Nou [[2, STREET, 3.000, 56.25 km]]", + "Carrer de Santa Clara (Poble Nou), Sant Vicenç dels Horts [[2, STREET, 3.000, 56.25 km]]", + "Carrer Vell de Santa Clara, Manresa [[2, STREET, 3.000, 66.96 km]]", + "Carrer Nou de Santa Clara, Centre Històric [[2, STREET, 3.000, 67.15 km]]", + "Carrer Nou de Santa Clara (Les Escodines), Manresa [[2, STREET, 3.000, 67.15 km]]", + "Carrer de Santa Clara, Masquefa [[2, STREET, 3.000, 68.25 km]]", + "Carrer Santa Clara, Castelló d'Empúries [[2, STREET, 3.000, 81.65 km]]", + "Carrer de Santa Clara, Vilafranca del Penedès [[2, STREET, 3.000, 81.86 km]]", + "Carrer de Santa Clara, Castelló d'Empúries [[2, STREET, 3.000, 81.93 km]]", + "Santa Clara [[2, POI, 2.000, 7784.16 km]]", + "Santa Clara [[2, POI, 2.000, 30.97 km]]", + "Santa Clara [[2, POI, 2.000, 8583.12 km]]", + "Santa Clara [[2, POI, 2.000, 44.32 km]]", + "Pastisseria Santa Clara [[2, POI, 2.000, 44.34 km]]", + "Escola Santa Clara [[2, POI, 2.000, 44.69 km]]", + "Santa Clara [[2, POI, 2.000, 45.45 km]]", + "L11 - Santa Clara [[2, POI, 2.000, 45.52 km]]", + "Santa Clara [[2, POI, 2.000, 9114.25 km]]", + "CAP SANTA CLARA [[2, POI, 2.000, 45.64 km]]", + "CAP Santa Clara [[2, POI, 2.000, 45.64 km]]", + "L11 - Santa Clara [[2, POI, 2.000, 45.74 km]]", + "Plaça de Santa Clara [[2, POI, 2.000, 47.62 km]]", + "Pl. Santa Clara [[2, POI, 2.000, 47.62 km]]", + "Santa Clara de Olimar [[2, POI, 2.000, 10164.87 km]]", + "Claverol / Santa Clara [[2, POI, 2.000, 56.34 km]]", + "Monestir de Santa Clara [[2, POI, 2.000, 66.71 km]]", + "Santa Clara [[2, POI, 2.000, 66.75 km]]", + "La Sínia de Santa Clara [[2, POI, 2.000, 66.81 km]]", + "Restaurant Santa Clara [[2, POI, 2.000, 69.76 km]]", + "Hostal Santa Clara [[2, POI, 2.000, 69.77 km]]", + "Santa Maria del Castell de Claramunt [[2, POI, 2.000, 79.46 km]]", + "Monestir de Santa Clara [[2, POI, 2.000, 81.26 km]]", + "Santa Clara / Muralla de Sant Magí [[2, POI, 2.000, 81.86 km]]", + "Convent de Santa Clara [[2, POI, 2.000, 82.15 km]]", + "Convent de Santa Clara [[2, POI, 2.000, 137.22 km]]", + "Santa Clara del Mullol [[2, POI, 2.000, 137.89 km]]", + "Plaça de la Mare Santa Clara [[2, POI, 2.000, 166.36 km]]", + "Pujada de Santa Clara [[2, POI, 2.000, 196.30 km]]", + "Carrer Nou de Santa Clara [[2, POI, 2.000, 196.39 km]]" ], "amenities": [ From 99aa47d5af8224fe543c476f91e51057e84cd8f4 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Jun 2020 13:43:27 +0200 Subject: [PATCH 19/26] Improve tests --- .../resources/search/{charging_stations.json => kiev.json} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename OsmAnd-java/src/test/resources/search/{charging_stations.json => kiev.json} (99%) diff --git a/OsmAnd-java/src/test/resources/search/charging_stations.json b/OsmAnd-java/src/test/resources/search/kiev.json similarity index 99% rename from OsmAnd-java/src/test/resources/search/charging_stations.json rename to OsmAnd-java/src/test/resources/search/kiev.json index 740ea4bc7c..84de0dd6b0 100644 --- a/OsmAnd-java/src/test/resources/search/charging_stations.json +++ b/OsmAnd-java/src/test/resources/search/kiev.json @@ -11,9 +11,9 @@ }, "phrase": "Київ Саксаганського вулиця 32", "results": [ - "32, Саксаганського вулиця, Київ", - "Саксаганського вулиця, Київ", - "вул. Саксаганського (на вимогу)" + "32, Саксаганського вулиця, Київ [[3, HOUSE, 0.430, 1.79 km]]", + "Саксаганського вулиця, Київ [[2, STREET, 3.000, 1.61 km]]", + "вул. Саксаганського (на вимогу) [[1, POI, 2.000, 1.61 km]]" ], "amenities": [ { From 4a803afc3bf595d199c4f4f318964956d4b87eb0 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 3 Jun 2020 17:03:21 +0300 Subject: [PATCH 20/26] Added multiple search tests --- .../net/osmand/search/SearchUICoreTest.java | 106 +++++++++----- .../resources/search/100_bridge_street.json | 132 ++++++++++-------- 2 files changed, 146 insertions(+), 92 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index da64144e4c..1e7e1889fc 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -100,7 +100,20 @@ public class SearchUICoreTest { BinaryMapIndexReaderTest reader = new BinaryMapIndexReaderTest(); JSONObject sourceJson = new JSONObject(sourceJsonText); - String phraseText = sourceJson.getString("phrase"); + JSONArray phrasesJson = sourceJson.optJSONArray("phrases"); + String singlePhrase = sourceJson.optString("phrase", null); + List phrases = new ArrayList<>(); + if (singlePhrase != null) { + phrases.add(singlePhrase); + } + if (phrasesJson != null) { + for (int i = 0; i < phrasesJson.length(); i++) { + String phrase = phrasesJson.optString(i); + if (phrase != null) { + phrases.add(phrase); + } + } + } JSONObject settingsJson = sourceJson.getJSONObject("settings"); if (sourceJson.has("amenities")) { JSONArray amenitiesArr = sourceJson.getJSONArray("amenities"); @@ -136,26 +149,25 @@ public class SearchUICoreTest { reader.matchedCities = matchedCities; reader.streetCities = streetCities; } - List results = new ArrayList<>(); + List> results = new ArrayList<>(); + for (int i = 0; i < phrases.size(); i++) { + results.add(new ArrayList()); + } if (sourceJson.has("results")) { - JSONArray resultsArr = sourceJson.getJSONArray("results"); - for (int i = 0; i < resultsArr.length(); i++) { - results.add(resultsArr.getString(i)); - } + parseResults(sourceJson, "results", results); } if (TEST_EXTRA_RESULTS && sourceJson.has("extra-results")) { - JSONArray resultsArr = sourceJson.getJSONArray("extra-results"); - for (int i = 0; i < resultsArr.length(); i++) { - results.add(resultsArr.getString(i)); - } + parseResults(sourceJson, "extra-results", results); + } + + Assert.assertEquals(phrases.size(), results.size()); + if (phrases.size() != results.size()) { + return; } SearchSettings s = SearchSettings.parseJSON(settingsJson); s.setOfflineIndexes(Collections.singletonList(reader)); - SearchPhrase phrase = SearchPhrase.emptyPhrase(s); - phrase = phrase.generateNewPhrase(phraseText, s); - final SearchUICore core = new SearchUICore(MapPoiTypes.getDefault(), "en", false); core.init(); @@ -170,31 +182,57 @@ public class SearchUICoreTest { return false; } }; - SearchResultMatcher matcher = new SearchResultMatcher(rm, phrase, 1, new AtomicInteger(1), -1); - core.searchInternal(phrase, matcher); - SearchResultCollection collection = new SearchResultCollection(phrase); - collection.addSearchResults(matcher.getRequestResults(), true, true); - List searchResults = collection.getCurrentSearchResults(); - int i = 0; boolean simpleTest = true; - for (SearchResult result : searchResults) { - String expected = results.get(i++); - if(simpleTest && expected.indexOf('[') != -1) { - expected = expected.substring(0, expected.indexOf('[')).trim(); - } -// String present = result.toString(); - String present = formatResult(simpleTest, result, phrase); - if (!Algorithms.stringsEqual(expected, present)) { - System.out.println(String.format("Mismatch for '%s' != '%s'. Result: ", expected, - present)); - for (SearchResult r : searchResults) { - System.out.println(String.format("\t\"%s\",", formatResult(false, r, phrase))); + SearchPhrase emptyPhrase = SearchPhrase.emptyPhrase(s); + for (int k = 0; k < phrases.size(); k++) { + String text = phrases.get(k); + List result = results.get(k); + SearchPhrase phrase = emptyPhrase.generateNewPhrase(text, s); + SearchResultMatcher matcher = new SearchResultMatcher(rm, phrase, 1, new AtomicInteger(1), -1); + core.searchInternal(phrase, matcher); + + SearchResultCollection collection = new SearchResultCollection(phrase); + collection.addSearchResults(matcher.getRequestResults(), true, true); + List searchResults = collection.getCurrentSearchResults(); + int i = 0; + for (SearchResult res : searchResults) { + String expected = result.get(i++); + if (simpleTest && expected.indexOf('[') != -1) { + expected = expected.substring(0, expected.indexOf('[')).trim(); + } +// String present = result.toString(); + String present = formatResult(simpleTest, res, phrase); + if (!Algorithms.stringsEqual(expected, present)) { + System.out.println(String.format("Phrase: %s", phrase)); + System.out.println(String.format("Mismatch for '%s' != '%s'. Result: ", expected, present)); + for (SearchResult r : searchResults) { + System.out.println(String.format("\t\"%s\",", formatResult(false, r, phrase))); + } + } + Assert.assertEquals(expected, present); + if (i >= results.size()) { + break; } } - Assert.assertEquals(expected, present); - if (i >= results.size()) { - break; + } + } + + private void parseResults(JSONObject sourceJson, String tag, List> results) { + List result = results.get(0); + JSONArray resultsArr = sourceJson.getJSONArray(tag); + boolean hasInnerArray = resultsArr.length() > 0 && resultsArr.optJSONArray(0) != null; + for (int i = 0; i < resultsArr.length(); i++) { + if (hasInnerArray) { + JSONArray innerArray = resultsArr.optJSONArray(i); + if (innerArray != null && results.size() > i) { + result = results.get(i); + for (int k = 0; k < innerArray.length(); k++) { + result.add(innerArray.getString(k)); + } + } + } else { + result.add(resultsArr.getString(i)); } } } diff --git a/OsmAnd-java/src/test/resources/search/100_bridge_street.json b/OsmAnd-java/src/test/resources/search/100_bridge_street.json index de40be7421..496ec126c4 100644 --- a/OsmAnd-java/src/test/resources/search/100_bridge_street.json +++ b/OsmAnd-java/src/test/resources/search/100_bridge_street.json @@ -9,67 +9,83 @@ "emptyQueryAllowed": false, "sortByName": false }, - "phrase": "100 Bridge Street", + "phrases": [ "100 bridge", "100 bridge street", "100 bridge street westbrook" ], "results": [ - "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", - "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", - "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + [ + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", + "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + ], + [ + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", + "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + ], + [ + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", + "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + ] ], "extra-results" : [ - "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", - "Bridge Street, Westbrook [[2, STREET, 3.000, 11.35 km]]", - "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", - "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", - "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", - "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", - "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", - "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", - "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", - "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", - "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", - "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", - "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", - "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", - "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", - "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", - "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", - "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", - "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", - "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", - "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", - "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", - "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", - "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", - "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", - "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", - "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", - "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]", - "Bridge Street [[2, POI, 2.000, 11.59 km]]", - "Bridge Street Dam [[2, POI, 2.000, 23.62 km]]", - "Bridge Street [[2, POI, 2.000, 27.24 km]]", - "Bridge Street [[2, POI, 2.000, 34.36 km]]", - "Bridge Street [[2, POI, 2.000, 41.33 km]]", - "Bridge Street Dam [[2, POI, 2.000, 41.35 km]]", - "Bridge Street [[2, POI, 2.000, 43.84 km]]", - "Bridge Street [[2, POI, 2.000, 76.87 km]]", - "Bridge Street [[2, POI, 2.000, 77.27 km]]", - "Bridge Street [[2, POI, 2.000, 82.37 km]]", - "Bridge Street [[2, POI, 2.000, 88.20 km]]", - "The Bridge Street Green [[2, POI, 2.000, 104.21 km]]", - "Bridge Street [[2, POI, 2.000, 104.29 km]]", - "Bridge Street [[2, POI, 2.000, 110.92 km]]", - "Bridge Street [[2, POI, 2.000, 116.14 km]]", - "Bridge Street [[2, POI, 2.000, 116.20 km]]", - "Bridge Street [[2, POI, 2.000, 116.26 km]]", - "Bridge Street [[2, POI, 2.000, 119.68 km]]", - "Bridge Street [[2, POI, 2.000, 151.84 km]]", - "Bridge Street [[2, POI, 2.000, 224.29 km]]", - "Bridge Street [[2, POI, 2.000, 243.40 km]]", - "Bridge Street [[2, POI, 2.000, 394.32 km]]", - "Bridge Street [[2, POI, 2.000, 415.17 km]]", - "Bridge Street [[2, POI, 2.000, 434.56 km]]", - "Pool Street, Bridge Road, Biddeford [[2, STREET_INTERSECTION, 0.430, 35.32 km]]", - "Beach Street, Bridge Lane, Ogunquit [[2, STREET_INTERSECTION, 0.430, 56.87 km]]" + [ + "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Westbrook [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", + "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", + "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", + "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", + "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", + "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", + "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", + "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", + "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", + "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", + "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", + "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", + "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", + "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", + "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", + "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", + "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", + "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", + "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", + "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", + "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", + "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]", + "Bridge Street [[2, POI, 2.000, 11.59 km]]", + "Bridge Street Dam [[2, POI, 2.000, 23.62 km]]", + "Bridge Street [[2, POI, 2.000, 27.24 km]]", + "Bridge Street [[2, POI, 2.000, 34.36 km]]", + "Bridge Street [[2, POI, 2.000, 41.33 km]]", + "Bridge Street Dam [[2, POI, 2.000, 41.35 km]]", + "Bridge Street [[2, POI, 2.000, 43.84 km]]", + "Bridge Street [[2, POI, 2.000, 76.87 km]]", + "Bridge Street [[2, POI, 2.000, 77.27 km]]", + "Bridge Street [[2, POI, 2.000, 82.37 km]]", + "Bridge Street [[2, POI, 2.000, 88.20 km]]", + "The Bridge Street Green [[2, POI, 2.000, 104.21 km]]", + "Bridge Street [[2, POI, 2.000, 104.29 km]]", + "Bridge Street [[2, POI, 2.000, 110.92 km]]", + "Bridge Street [[2, POI, 2.000, 116.14 km]]", + "Bridge Street [[2, POI, 2.000, 116.20 km]]", + "Bridge Street [[2, POI, 2.000, 116.26 km]]", + "Bridge Street [[2, POI, 2.000, 119.68 km]]", + "Bridge Street [[2, POI, 2.000, 151.84 km]]", + "Bridge Street [[2, POI, 2.000, 224.29 km]]", + "Bridge Street [[2, POI, 2.000, 243.40 km]]", + "Bridge Street [[2, POI, 2.000, 394.32 km]]", + "Bridge Street [[2, POI, 2.000, 415.17 km]]", + "Bridge Street [[2, POI, 2.000, 434.56 km]]", + "Pool Street, Bridge Road, Biddeford [[2, STREET_INTERSECTION, 0.430, 35.32 km]]", + "Beach Street, Bridge Lane, Ogunquit [[2, STREET_INTERSECTION, 0.430, 56.87 km]]" + ], + [], + [] ], "amenities": [ { From b755d328e9aef81a4a81ba6db339050749f4a113 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Jun 2020 16:08:57 +0200 Subject: [PATCH 21/26] Improve tests --- .../resources/search/100_bridge_street.json | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/test/resources/search/100_bridge_street.json b/OsmAnd-java/src/test/resources/search/100_bridge_street.json index 496ec126c4..d557d810b9 100644 --- a/OsmAnd-java/src/test/resources/search/100_bridge_street.json +++ b/OsmAnd-java/src/test/resources/search/100_bridge_street.json @@ -22,9 +22,37 @@ "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" ], [ - "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", - "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", - "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[4, HOUSE, 0.430, 11.29 km]]", + "Bridge Street, Westbrook [[3, STREET, 3.000, 11.35 km]]", + "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]", + "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", + "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", + "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", + "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", + "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", + "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", + "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", + "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", + "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", + "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", + "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", + "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", + "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", + "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", + "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", + "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", + "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", + "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", + "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", + "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", + "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", + "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]" ] ], "extra-results" : [ From 811e6ebbf90cc8979453ff48f582c012c53ea1ba Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Jun 2020 16:21:29 +0200 Subject: [PATCH 22/26] Fix tests --- .../net/osmand/search/SearchUICoreTest.java | 2 +- .../resources/search/100_bridge_street.json | 149 +++++++++++------- 2 files changed, 92 insertions(+), 59 deletions(-) diff --git a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java index 1e7e1889fc..f3ab84c76b 100644 --- a/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/search/SearchUICoreTest.java @@ -211,7 +211,7 @@ public class SearchUICoreTest { } } Assert.assertEquals(expected, present); - if (i >= results.size()) { + if (i >= result.size()) { break; } } diff --git a/OsmAnd-java/src/test/resources/search/100_bridge_street.json b/OsmAnd-java/src/test/resources/search/100_bridge_street.json index d557d810b9..c100429032 100644 --- a/OsmAnd-java/src/test/resources/search/100_bridge_street.json +++ b/OsmAnd-java/src/test/resources/search/100_bridge_street.json @@ -12,9 +12,9 @@ "phrases": [ "100 bridge", "100 bridge street", "100 bridge street westbrook" ], "results": [ [ - "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", - "100, Bridge Street, Westbrook [[3, HOUSE, 0.430, 11.29 km]]", - "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]" + "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", + "100, Bridge Street, Westbrook [[2, HOUSE, 0.430, 11.29 km]]", + "100, Bridge Street, Yarmouth [[2, HOUSE, 0.430, 23.69 km]]" ], [ "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", @@ -57,62 +57,95 @@ ], "extra-results" : [ [ - "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", - "Bridge Street, Westbrook [[2, STREET, 3.000, 11.35 km]]", - "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", - "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", - "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", - "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", - "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", - "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", - "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", - "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", - "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", - "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", - "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", - "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", - "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", - "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", - "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", - "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", - "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", - "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", - "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", - "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", - "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", - "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", - "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", - "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", - "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", - "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]", - "Bridge Street [[2, POI, 2.000, 11.59 km]]", - "Bridge Street Dam [[2, POI, 2.000, 23.62 km]]", - "Bridge Street [[2, POI, 2.000, 27.24 km]]", - "Bridge Street [[2, POI, 2.000, 34.36 km]]", - "Bridge Street [[2, POI, 2.000, 41.33 km]]", - "Bridge Street Dam [[2, POI, 2.000, 41.35 km]]", - "Bridge Street [[2, POI, 2.000, 43.84 km]]", - "Bridge Street [[2, POI, 2.000, 76.87 km]]", - "Bridge Street [[2, POI, 2.000, 77.27 km]]", - "Bridge Street [[2, POI, 2.000, 82.37 km]]", - "Bridge Street [[2, POI, 2.000, 88.20 km]]", - "The Bridge Street Green [[2, POI, 2.000, 104.21 km]]", - "Bridge Street [[2, POI, 2.000, 104.29 km]]", - "Bridge Street [[2, POI, 2.000, 110.92 km]]", - "Bridge Street [[2, POI, 2.000, 116.14 km]]", - "Bridge Street [[2, POI, 2.000, 116.20 km]]", - "Bridge Street [[2, POI, 2.000, 116.26 km]]", - "Bridge Street [[2, POI, 2.000, 119.68 km]]", - "Bridge Street [[2, POI, 2.000, 151.84 km]]", - "Bridge Street [[2, POI, 2.000, 224.29 km]]", - "Bridge Street [[2, POI, 2.000, 243.40 km]]", - "Bridge Street [[2, POI, 2.000, 394.32 km]]", - "Bridge Street [[2, POI, 2.000, 415.17 km]]", - "Bridge Street [[2, POI, 2.000, 434.56 km]]", - "Pool Street, Bridge Road, Biddeford [[2, STREET_INTERSECTION, 0.430, 35.32 km]]", - "Beach Street, Bridge Lane, Ogunquit [[2, STREET_INTERSECTION, 0.430, 56.87 km]]" + "Bridge Street, Frenchtown [[1, STREET, 3.000, 11.35 km]]", + "Bridge Street, Westbrook [[1, STREET, 3.000, 11.35 km]]", + "Bridge Street, Yarmouth [[1, STREET, 3.000, 23.44 km]]", + "Bridge Street, Cornish [[1, STREET, 3.000, 27.39 km]]", + "Bridge Street (Ocean Park), Old Orchard Beach [[1, STREET, 3.000, 28.42 km]]", + "Bridge Street (Newfield), West Newfield [[1, STREET, 3.000, 32.66 km]]", + "Bridge Street, Newfield [[1, STREET, 3.000, 32.66 km]]", + "Bridge Street (Sprague City), West Newfield [[1, STREET, 3.000, 32.72 km]]", + "Bridge Street, Sprague City [[1, STREET, 3.000, 33.02 km]]", + "Bridge Street, Kezar Falls [[1, STREET, 3.000, 34.35 km]]", + "Bridge Road, Biddeford [[1, STREET, 3.000, 35.42 km]]", + "Bridge Street (Springvale), Sanford [[1, STREET, 3.000, 41.40 km]]", + "Bridge Street, Springvale [[1, STREET, 3.000, 41.40 km]]", + "Bridge Street, Brunswick [[1, STREET, 3.000, 43.74 km]]", + "Bridge Street, Lewiston [[1, STREET, 3.000, 43.86 km]]", + "Bridge Street, Topsham [[1, STREET, 3.000, 43.93 km]]", + "Bridge Road, Brunswick [[1, STREET, 3.000, 52.12 km]]", + "Bridge Street, Bath [[1, STREET, 3.000, 53.34 km]]", + "Bridge Lane, Ogunquit [[1, STREET, 3.000, 56.91 km]]", + "Bridge Street, Ogunquit [[1, STREET, 3.000, 56.93 km]]", + "Bridge Road, North Waterford [[1, STREET, 3.000, 57.76 km]]", + "Bridge Street, Berwick [[1, STREET, 3.000, 62.86 km]]", + "Bridge Street, Richmond [[1, STREET, 3.000, 65.70 km]]", + "Bridge Road, Edgecomb [[1, STREET, 3.000, 68.32 km]]", + "Bridge Road, Wiscasset [[1, STREET, 3.000, 68.34 km]]", + "Bridge Street, Boothbay Harbor [[1, STREET, 3.000, 68.39 km]]", + "Bridge Street, Gardiner [[1, STREET, 3.000, 77.20 km]]", + "Bridge Street (Oak Terrace), Kittery [[1, STREET, 3.000, 77.36 km]]", + "Bridge Street, Randolph [[1, STREET, 3.000, 77.40 km]]", + "Bridge Street, Oak Terrace [[1, STREET, 3.000, 77.41 km]]", + "Bridge Street, Gilead [[1, STREET, 3.000, 82.07 km]]", + "Bridge Street, Livermore Falls [[1, STREET, 3.000, 83.24 km]]", + "Bridge Street, Augusta [[1, STREET, 3.000, 83.82 km]]", + "Bridge Street, Jay [[1, STREET, 3.000, 85.89 km]]" + ], + [ + "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Westbrook [[2, STREET, 3.000, 11.35 km]]", + "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", + "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", + "Bridge Street (Ocean Park), Old Orchard Beach [[2, STREET, 3.000, 28.42 km]]", + "Bridge Street (Newfield), West Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street, Newfield [[2, STREET, 3.000, 32.66 km]]", + "Bridge Street (Sprague City), West Newfield [[2, STREET, 3.000, 32.72 km]]", + "Bridge Street, Sprague City [[2, STREET, 3.000, 33.02 km]]", + "Bridge Street, Kezar Falls [[2, STREET, 3.000, 34.35 km]]", + "Bridge Street (Springvale), Sanford [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Springvale [[2, STREET, 3.000, 41.40 km]]", + "Bridge Street, Brunswick [[2, STREET, 3.000, 43.74 km]]", + "Bridge Street, Lewiston [[2, STREET, 3.000, 43.86 km]]", + "Bridge Street, Topsham [[2, STREET, 3.000, 43.93 km]]", + "Bridge Street, Bath [[2, STREET, 3.000, 53.34 km]]", + "Bridge Street, Ogunquit [[2, STREET, 3.000, 56.93 km]]", + "Bridge Street, Berwick [[2, STREET, 3.000, 62.86 km]]", + "Bridge Street, Richmond [[2, STREET, 3.000, 65.70 km]]", + "Bridge Street, Boothbay Harbor [[2, STREET, 3.000, 68.39 km]]", + "Bridge Street, Gardiner [[2, STREET, 3.000, 77.20 km]]", + "Bridge Street (Oak Terrace), Kittery [[2, STREET, 3.000, 77.36 km]]", + "Bridge Street, Randolph [[2, STREET, 3.000, 77.40 km]]", + "Bridge Street, Oak Terrace [[2, STREET, 3.000, 77.41 km]]", + "Bridge Street, Gilead [[2, STREET, 3.000, 82.07 km]]", + "Bridge Street, Livermore Falls [[2, STREET, 3.000, 83.24 km]]", + "Bridge Street, Augusta [[2, STREET, 3.000, 83.82 km]]", + "Bridge Street, Jay [[2, STREET, 3.000, 85.89 km]]", + "Bridge Street [[2, POI, 2.000, 11.59 km]]", + "Bridge Street Dam [[2, POI, 2.000, 23.62 km]]", + "Bridge Street [[2, POI, 2.000, 27.24 km]]", + "Bridge Street [[2, POI, 2.000, 34.36 km]]", + "Bridge Street [[2, POI, 2.000, 41.33 km]]", + "Bridge Street Dam [[2, POI, 2.000, 41.35 km]]", + "Bridge Street [[2, POI, 2.000, 43.84 km]]", + "Bridge Street [[2, POI, 2.000, 76.87 km]]", + "Bridge Street [[2, POI, 2.000, 77.27 km]]", + "Bridge Street [[2, POI, 2.000, 82.37 km]]", + "Bridge Street [[2, POI, 2.000, 88.20 km]]", + "The Bridge Street Green [[2, POI, 2.000, 104.21 km]]", + "Bridge Street [[2, POI, 2.000, 104.29 km]]", + "Bridge Street [[2, POI, 2.000, 110.92 km]]", + "Bridge Street [[2, POI, 2.000, 116.14 km]]", + "Bridge Street [[2, POI, 2.000, 116.20 km]]", + "Bridge Street [[2, POI, 2.000, 116.26 km]]", + "Bridge Street [[2, POI, 2.000, 119.68 km]]", + "Bridge Street [[2, POI, 2.000, 151.84 km]]", + "Bridge Street [[2, POI, 2.000, 224.29 km]]", + "Bridge Street [[2, POI, 2.000, 243.40 km]]", + "Bridge Street [[2, POI, 2.000, 394.32 km]]", + "Bridge Street [[2, POI, 2.000, 415.17 km]]", + "Bridge Street [[2, POI, 2.000, 434.56 km]]" ], - [], [] ], "amenities": [ From 1f011927cb0f0bd129fed7478070a1b152064514 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 4 Jun 2020 13:30:07 +0300 Subject: [PATCH 23/26] fix white point --- OsmAnd/res/drawable-hdpi/map_compass.png | Bin 1510 -> 0 bytes OsmAnd/res/drawable-hdpi/map_compass_bearing.png | Bin 1491 -> 0 bytes .../drawable-hdpi/map_compass_bearing_white.png | Bin 1491 -> 0 bytes OsmAnd/res/drawable-hdpi/map_compass_niu.png | Bin 1315 -> 0 bytes .../res/drawable-hdpi/map_compass_niu_white.png | Bin 1315 -> 0 bytes OsmAnd/res/drawable-hdpi/map_compass_white.png | Bin 1510 -> 0 bytes OsmAnd/res/drawable-mdpi/map_compass.png | Bin 1338 -> 0 bytes OsmAnd/res/drawable-mdpi/map_compass_bearing.png | Bin 1326 -> 0 bytes .../drawable-mdpi/map_compass_bearing_white.png | Bin 1326 -> 0 bytes OsmAnd/res/drawable-mdpi/map_compass_niu.png | Bin 1225 -> 0 bytes .../res/drawable-mdpi/map_compass_niu_white.png | Bin 1230 -> 0 bytes OsmAnd/res/drawable-mdpi/map_compass_white.png | Bin 1341 -> 0 bytes OsmAnd/res/drawable-xhdpi/map_compass.png | Bin 1693 -> 0 bytes .../res/drawable-xhdpi/map_compass_bearing.png | Bin 1690 -> 0 bytes .../drawable-xhdpi/map_compass_bearing_white.png | Bin 1690 -> 0 bytes OsmAnd/res/drawable-xhdpi/map_compass_niu.png | Bin 1421 -> 0 bytes .../res/drawable-xhdpi/map_compass_niu_white.png | Bin 1421 -> 0 bytes OsmAnd/res/drawable-xhdpi/map_compass_white.png | Bin 1695 -> 0 bytes OsmAnd/res/drawable-xxhdpi/map_compass.png | Bin 1979 -> 0 bytes .../res/drawable-xxhdpi/map_compass_bearing.png | Bin 2032 -> 0 bytes .../map_compass_bearing_white.png | Bin 2032 -> 0 bytes OsmAnd/res/drawable-xxhdpi/map_compass_niu.png | Bin 1655 -> 0 bytes .../drawable-xxhdpi/map_compass_niu_white.png | Bin 1653 -> 0 bytes OsmAnd/res/drawable-xxhdpi/map_compass_white.png | Bin 1978 -> 0 bytes .../mapcontextmenu/MapContextMenuFragment.java | 2 +- .../net/osmand/plus/views/FavouritesLayer.java | 2 +- 26 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass.png delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass_bearing.png delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass_bearing_white.png delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass_niu.png delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass_niu_white.png delete mode 100644 OsmAnd/res/drawable-hdpi/map_compass_white.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass_bearing.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass_bearing_white.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass_niu.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass_niu_white.png delete mode 100644 OsmAnd/res/drawable-mdpi/map_compass_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass_bearing.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass_bearing_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass_niu.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass_niu_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/map_compass_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass_bearing.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass_bearing_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass_niu.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass_niu_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/map_compass_white.png diff --git a/OsmAnd/res/drawable-hdpi/map_compass.png b/OsmAnd/res/drawable-hdpi/map_compass.png deleted file mode 100644 index e852a4db1de10d234e5636021d3f8b70133f3b55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1510 zcmbVMeM}Q)7(d!sQFK&MhOoM`$b{kb?%H14yV=n%I_fBEuwb{C#cS^^J)phz?vRsA zBN!PNV{nTL+mfZY7?Cj(7L&!Ob5S;9bRT}OY`Db8h!OXtTb2?J{tm zImY$qtcu)X*FPW?@&{12AOe&!Sg;5|no%olASsKLwys5uP{s)xZX_^*W+)Rw7}2>$ z550+8l&SZ4=X^oQu8+xblELxz_I5+N$smYLI7!nqP8e~c5rZ0-v^62K3YL&cvlcu+ ziimtt=7j{BvB-vnHrcL+Odo_0Px}224JV|zM8TBd3Y)}91A)imnYd=PCAl8_OXHE+ zQgCY$;PpTf+QbN~N3=8xhPivZql_YC!@Ml=uqbS+M~Jk=K|=O)n=R3Q*Enun_V{2 z3wppv&v|u9b5b{&H@aMz z{4m{o^G4c*7M>}^H4W~k=Jz5ga>=dT1I_%e>GkN1QkU+TAm-OSv3~TG)q`K3-go=( zjdVwB%b}yO^zNPJ^t@FEcdZ$F`bupSTu^;fKX?l*h?T83K}&>g>xHLQ70UQO2NR{l5^zDKs4~Bb4{nBUV3W(j@O_@(8`g~1&db?`?)~foi)yGlXXsFO;rD+RYjN*{HHWM$Y#R>HMWIDwFTM3< z@s;Vj3qYkhwXl$?2+*3ram}lZy8KQ>v-DJ9&#}JgO#!l~KWEH+d3)rB}3TjXBlU)?nU!f~eeKM)J+PBiNBL|rXh4#60m$qmAyuRu> K&k@(=u73d5B?&VC diff --git a/OsmAnd/res/drawable-hdpi/map_compass_bearing.png b/OsmAnd/res/drawable-hdpi/map_compass_bearing.png deleted file mode 100644 index 525fec84765f82f39805f00075caa62e43cdd623..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1491 zcmbVMZA=qq9KW^`9B--4sTc^42b(%+@A}?5>7evLN-TD@gE|+-UGEA9v{$YNEle{i z0}DaS2wQN8TE||TGuxuX4{pY7*2S5*7{;O@*^G^G!w)#3TZ}Qfr%2sC5I^jayXW~o z&+q^Hzu$nfZgXzdnk)oCa_u#g3$7)pcWDOvUPs2p;F2#@d8BQEPYTl_hgeyG;eg#w zH*qeGX1m&d;K~q0(aF0#lE<-y^a_48ox-Ri{vgywkh1bfkoLB65@5I{K43v_e{~iG zJZnK43=Z58v~kURO}EHx>#lQqyIZ{kiTd!d0rCkQ^yzz z<{?t61%2$4$KeDvLF9lzZB%)2jUJc?wZ>pH5vEe0g))YlF)gmb3DTe=aV=PQP-snL zeWZ)3Ua$ov3)(D6K@!8l;jlWaQww4frXdId!?l=JtAYqss4F1R5mg{moMxc7kXPh` z5-$Wmijii74#|Q-PalWi4>}xAhy$U8M8T9{5ju!z)Hvq%r{bDNha?yGuN#Y^L+-91 zhq<_r&>?zZJ$%J!Wth9C8%hD8H{@24hee^=D8bv|=K_+QvY_xr&GIa%^)X(K@zE-; z#>A-zjozd(;{>kqY0PHU$FVvSj;DDR)5j^QlCt4io7rmBXsYyP6IErdvgs?$8p>K- ztxxOP10jhHc)7G~9@@q!s|hz!RZrC=Z6ZfYg6I~6wsaRbn*~V-H48ytv&~l>tZ(20 ztPl=uNR{bv)D$Q3og7;&3Vtx3XOdsU2iB<5F@9|2jRu3x zpf#Wi`t1MB9|oPmQqA(8=1CvHj!bQzi~Q4kM5LlD^=J7sl8rkMwi z9+jVKlyAxD%^4zN%EoVBST?d*oIWN`8eRJ12NE?Wl_!v7JvdcR`bz!26}5_4up9i{ zf8xxM2eJ<3dUxYM^qooP2UFHt@w@vE6~&W^WIU_Xhg;9j%z`d3{QcThibU4kPG`RI zWOBo`+L;+(2X!U!7ndCyR_DDWXX@lF<|DV7X8{d<0xo}s+u|r3%}kVidAj*8syf5w zn7aS$r^CtUu}=>4-n*=7d}jJ!{`m{vT`iT*F*n>q%f z*Z&|gGIj>O_Kj9vIx^VHL_I4H%bn|YKODT0v;8QsVpFVd?Benpt36Z8jt*_V(6X&K zii7&KAOD&=cxwFjKgrr9Ex&0++tSh6jRQmV%$rM|ugN7x3RfTrGIHY$*<2~;-22|e zS?9xzW!+Nr>i*X=>Fk5+D$4R>g*~3E*w4|(D&qF^olHvKbrVhRJY5w-{q|Z;`tFLHuKv+`aGf zzR&M@e$UtS+3UCFWv|Uf5G2o9OFH0Ml6seC!tV{_@L{+Viq$T$f%k}EN?;K)!_zFV z`lx2s!BR}ep6}Um1j%UUoG#I2+eWx~pMpy1C?dW9L?cLfMI=DETUim%Y%}LKp|`(0 zivo@@p*yrT+!nB~Uaq!NU>iE?o$k(7w~;|BUIyh60vhnKA_XG8Hh++an9v2g1l*^N zF%&GQh^;2{F)5eL4lKOD0Iy>txj*$mjM-&G2DQua5-)yv}yuZfyD=f z-UP-&ILMksUr;ikUQrAX7#0qP6=Ai47n(7p(P+eQ6{b?jp@uxz;TNfh+#lSKwm`B$ zx4;ENj`xF`-6*#f+@oyQ~*;daLngR#kHUv6dmlpG?vs3 zIy(X^=3s+-NN~e?cs8WLFn3RPlv0Fji0uLgi$b-LygTG${i2mLq3}k*a15dH&~BFY zP;$3Y&&rKTjb3iRjkw&SG#D5U%c%7@p0=|T9w*5v(t_(O2D4eItkxLxWVNB%qNy?{ zNpnq&CXKcFgCga3vuWQP^u37HJ{3z?1eOwc!O8P&=`OH)d65r#`2et37OD4W!R;$*k zwCEz9`M>$YASo=>EdObq^bzdH)b`0JK;g+Sv3@u~0vwe;_{NI}BDrHF&CbX*`oW_| z73Z3y+j6^e2Z)%g>6;e{hPDdV#-&M}Lv!LtqV}Y00!cQ4Q|roJX*{^HE@KYt1Aq5U zoH_nL5|WiVoBE>fOxZt}Hs6ZhJ#@4Wkj^ z-I$rV+y9kkxa!jJ{%$(zT6IinFWvXB|4Q!8G2_ZDv7W;hSIn$&O&5#}?7Yy@upx?r z#`PcnlGlG~^tV5Wx@9fDsszjO;kwOz1C8{X%bu^zBZi7rA_*cg^M+);474A3@8X>O z;pXyAF?#jT>seIJ$i~X@!dOw4D?9d6G_qRuR`=AbeNWcd>5UO$S;vi>{KtLtLjU4}KWcjGtr|8U*b-(C6suK1u~yV;UIbMHBOZp(Bb qYRo@p9vB@h9?f4Hk{y&(c1e)Sb-PG>GJHSvo3&Qglb=;J?f(ZQ83+jg diff --git a/OsmAnd/res/drawable-hdpi/map_compass_niu.png b/OsmAnd/res/drawable-hdpi/map_compass_niu.png deleted file mode 100644 index 3ae3157990d451687edcf29528936407517342fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1315 zcmbVMTTC2P7@mT#gusev+CUS`$v_iP=eqX^TlO-$vdZGJtm!IgvvWDiPL{baGq4K} z3SxqNXhPy8Xkr7gvBB6zn`&ZxAVwb4^Z~1wT79s*G@@x=dPxWo&jO1+kUluc%sKx# z|M&mjf15L@{^yz-k2PW#)|}|&(`fCiybbl}dkdSNM@yR>%i4o_-Yy9y#KN*JLXc2} zVVH)3JTdwm?8dO#aV3+rv&lYA(p6HZ=#XXAKxho>?kO9BRD?DV;jp3w@w;Cw<3N#v z_(@NaP8v~IPF;5;slX2ITrBX6dh=hA$9 z&li${c)_*}j-pDX5?OMQx;acSfk1$wS&C%|q(N8{nk|$G&FZLH;Grd%ieW3d1}YW> zQ6IB|IAXdRf@&m_`-U}ZFHtCER9P@6hNLM~t;DsXZP{t~FO37Wt;~c0sWi0oF;hbI z$ahr1D0h!`R8d51xED)}`=b7Em|cG|Lt=308e8 z$oC%B`$#MoHKAbZW=7XXs$GyO=(cVZbOS`AJ5>iyom4bgFIiocGVMmqLsJ=ta@^Ea zu#;y_Ie>%gb-6@|^%9KRBN8s!jgsIM@~F2&QTBQ~E)VO$_we%n%^!tGQI%%-PxDld zP)Am_`=fw_{b7O{njo_>DrEi(3_BD}@Zn7Prnt4e-SbVZrmtzHsflxZHuv$Z_ugsq z3gh5h&B`C4t;bKLH*R!YolP~jT);-}IiG(c-hATsx)tW0G1uAh zuw`i+Z+T($X85h?>|F2Xk<|Sw&n!&?IrUQeFYDJkhc3T*e(k~bVr%Bi<`au|dTKw2 zG-QqvHR9UWKRsDZ`!8%q3nYP zcklbW@AG?}-}CQYjr8|6Hf(ReFsw1u=Z~UwSLLm*Mc=#F^fX#ptU%lv(34h9G9czt z^aKQ*8nCOqm6T>pE;9dJcXI?-C($JDXK0TtDLf(t7+7-~g za!lf2RmB?i;%lVh;Rq0Q0|J-RO~@3@0*-gmE;q+>&jJR?B;_F)ilBJG)ge#}SbuQj z%}|m;)E`{;g(NRNWLX)3By+i(GuPqNjTA}qJWo;#$uI=cAk1;ilJbORwpA_op(z_` z#!__+R4hsfea!OWi0N7g=}b7hVOTTQ6NOSn=A{ftJ1H`quEe#fZCX+IFO5yL&DeMb zl2K^tV}^|Ck!-7iQSKh?sG^A22!{+66-65H>+)C{YF5ba#nFvZQ5AtnCS;gMN`y>v zkl<;SBRmvO5lPzPQIb&U;3%qUXEQuU^8rQ_g8_~eX*$62BE<$p(dVH9J)Fz$sbWK# zX-S$4tG-p_dmS5iBvud&C|SA@)Af;R7et11OE-t~3=qZDs)M~pR87%yW_zVfYf<~5 zp=O~HH1srB&9k6x!oe-MWH;-P374C45v~L)q4+6|;8_kuE-@0rCh>K=@_+M3B2r|f zS^m>J)g#oAmF>nTAYo&epoS*MK%=r;LoZ;MO$_;cvHYFHgL1j+#^9EN_M+V`)V(+L z&fN>=THI0=%xo$B)cs)F@#xC!_QlCaqvH}b`pe*H<~VRp&L1npRnS_pm(0R+^JhQS z-aFd;xhK-J4@(TNbPDvh*4MSyjJ7phbAt01FBQ9AV4mC_xQ%tiX0)aQr-F_9m$#Pa zKQdFh9Dg}xv$*5=ukQF>E5xVzuJ%O!TzF=-0F=n#)-U%Q+Ozb;?AaH;D^DgOyH|Qo zEtc(8!_LUjh5FNn>jqw_k708)iMi{yy1%vETPj|;`PA0Z-^J^`j<5H{UN2-LI~;Em z=9f<7n-^Ygq3RxK) z->41u{{A$(vZLwknV*jh;bne$@tf3}H*Mq1Kit3n$>n0O)h}a?LF}d9*e~ANd1kco O+X@Bx{c}BoC;tKMMY>%8 diff --git a/OsmAnd/res/drawable-hdpi/map_compass_white.png b/OsmAnd/res/drawable-hdpi/map_compass_white.png deleted file mode 100644 index 347709b624c9caf5e771e51eff9404ff376f273a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1510 zcmbVMeQXnD7(d$5m5+ttnC^qgaT{Sou6Nh9yWY7<+iSi0A?f^z&3LO%Hf0+CMh#vYal6dIc(8n47Xzz9K|WxR!`#=c=|y! zZ!#aHTRlzFzBI{!#8fp&V_0u*uerD0EXnIJf}$u4w_p|vs%fA~pQy4aR8(pT7Cb=V zWFe^vk_hK5vJt6Ubs!qk2O%Vqe*Z(mqB5N*EoE4WO=5%@#}bKrTvOVL+6w-q@knhY z*p~!YD^R3vnbYbKtto)D+&$h=UQuI1KQ9YfQP@t8#C0ctsQNq(M7uHb0#93_5e`J6 zEXoliKq?m^C&z?P+kkexV@y6AqcOPVsL8{!?^5(*G<|y z_5#)?Dk>{-px|53d{1LtkHylA3|Li?gOb!)=z>5@QY9rOC1Hk{sybZPCWyS$t1Qcx z=|R*UAPYT!Z<3`1Je6l!cm#(A*2Xnh?Hp=rz-_24Vr8}XaT2Ahq!u}AVJ+4uGL7f| zZ~ici6qaw6|1?kGNbAV__TeaK!oy(#qBcRYHY%SEf3qEebVi@Y6--@-Oy0l0;&@oM zJX@EJf~Mx7XG-qR%)Rv20$=sB-s+zL7X%SjFD2XBrIk`QsvX|F3C1Y?8W>AQ?yR%hpA%TiZA z%EYfvWZdwR$7?X-3(QkRLr@nn|HhWxapAX23p`Qdu3i*G{ndt+Yfp0f)P)9@wdxwE6Q?#&u~ z?-cXek)DytBY)ESYL z`;!AED0E_0e9xibaXfA}oj)Ajr*@hyzFpPHq@fu`==8q!WZ<(6oAZBOpLezAV|RGd EKOxf%w*UYD diff --git a/OsmAnd/res/drawable-mdpi/map_compass.png b/OsmAnd/res/drawable-mdpi/map_compass.png deleted file mode 100644 index 82ee8e66f6a0a949f64e93fd0717c1c1a6a26996..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1338 zcmbVMU2NM_6m~nBRjpcOrK;LZgNwt)R@J|W6WeRnWN}KPEp13s8U~y2&vj$9wo}_( z(!Q{4Z0a;=urY}-34w$JdqSw4)*+AvqMI~$;bB7vBs5h#F!38^NY7bbl z?>+aP@0{=a`CMl3`Ie@gO&Er?qz0rcT05(6qYr%_l%jv2rOQj^y-Y}>M@0b zH5G3>im#K(r!yd7I}mVWm{4gZ1R?^-aN&p$=>aT~DVnEPnxF-d3yL%gHXa;#b2MGd zO8pzYkQBuWo>vqps#GeGr66fLV-zC@0!6bF%MwU~aHlO#E)$j;s9BJpt2#!}Gi(b~ zEy{{LF4O5wQ`690L_ao{(&H%7m7elA<`eAvHr2SzS?~qRWKJL?9tBp$Ng# z0!`=)&uco=f)Sdo+1U!uNHiac$N2;wk26d%bcp5nL^8zF;Y1`DNwPI;%5pu~Qen-v zfqZXZBag+32?xra?c{8GqSghOg6-LE!7hSCVy)_6->6|}cFEmeEz^3`5_F6cQ0sSW z6RhP~G`8TNg@ZvwWy1s$;uIoChfos2vW|L7QM53}1v!?(H}Km3%^!tGQPpPoPxI7{ zP)Am`o1=h)&0&HTnji;_iasABF|6)rN{Z*oKPW4!t9{#ux@Pj+*o*r2uOF*i>6$IQ ze|TW`f#lVOJoco&6n}Uuw(>?ky?Cks!k7{T7xvs9S;Sg_)xQ);+`gvA!~Smq%do<~ zceJCiev<20ZUP-2o^2S(9R9X~wVqGSVeLIa`RDnQ`AS=JV{-2S|H7s5N?piktG^hV zIC7!kUFpt_K#nj3;pJDZ?)bXbxA+}@dACp5_2!;m@BS9=y3T)6zZC2Fy)N_BYU2K- zi7y+#aUWdx;Lnal>-5|xw)~Pa{6dR=6;r0bV7zU}r=-E(seP1x?!hzup)+&4PF~qQ z`)TFoQ{CZ~*+*}UJPqnH;!wRZ3CPNw^UwNU1DChY65T%q&XkyYZT?@drG
    5pQk zo7<(&V=JAr&t>Ot`jQ^ecB{3!|Nc&Mf9T=y`lV$1=wJCS`U+>2y*Cc}-VR*1ZeUMz ZV((DB*H(WF5!Jt0Dmf^9eCX9v{{R^pvPl2{ diff --git a/OsmAnd/res/drawable-mdpi/map_compass_bearing.png b/OsmAnd/res/drawable-mdpi/map_compass_bearing.png deleted file mode 100644 index 4617da83faa66de840e1540e3664aefb263478ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1326 zcmbVMZA=?w9KY@yW6&uwEo{`}JeZ*2dN1wu+FL8My|Q(&wd+{u)EMsNIk-XZ%H6RR zJ}eaDg1EWFEg2>=8D9))m?OrRh>2E+if_>m`oZ{NnVP6EaeOdY;wC-?ihdyb;3ap@ z^M9V-|M!2t7t*Oid+PSrAqcW3aahQ}wYl=v*1+%eLiiS3_Sx~Qeaukpf@lIHq8Jju z5;<`IWPqrQjjVtWf}p3g-mINXKEcaI&LdVZo?5U?=`3}|{7|6}n3 z9MhCA-p3}XWIhH4wZr2kI5wW@mB)wVpn`Wjj)jUmB*+0<#EQ9L-QtU3e4Uqv`^qti zW9txmD2#77l})Cxm|+5p_4o;yqJ0<_^w6xI3v!(p17(s5kPJmoL7w&U6oYL(IJ9Oe zDxVR0Hf=#Ej1Ss&o+rsdq2MWaJ%%|z(!pSmq!^N62#6r8G2Ir6gl@G~83bU-rk1xg zL&qwNqGXKPVH|q85kfAXOl}eD)@Gt$%E+RaCut8w=5m#|*3p)o0sp$OE!yfG%L6h4 zEMwG^VLjB=sxr*o-3?WM&>Q|qQ-ehjhXq3(%>ms`2w@!Fcoa?H8C8;jq>6-0bASla zK8^@bL5fi6KtNG};^io+%Cnt5Ed)4D;QX;bBtp}1UzA}3vA8cl`D2`yi!)W-gl^fQ zE`zFV4cev!R^Z}2vAgQ>F%yWkVfGrvaJ384gNAKbgGL^U#n!8ib@XYvVic@LD`nb< zS^%bY3Mf6Mk;B&W%xl~Dp!mIBNoM>6?PDdvOZi|D{GtkbOOg~n%X(Rc#W(ep|C>J& zIz?8RimzHYieWb>H6An1u79d4=QpR% z{_VY=)c$%F}UwRW=c(`HFv6_myCZ=yZGFQH|+BW%O`WckaVpqnGcJ{mHFYNkZ a#{_~R+OMJM@}gi>{$PoCO1K*BpZo`T)Uuxd diff --git a/OsmAnd/res/drawable-mdpi/map_compass_bearing_white.png b/OsmAnd/res/drawable-mdpi/map_compass_bearing_white.png deleted file mode 100644 index 680be485dd0f2667c1d82a1ddb3a831c8a7204bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1326 zcmbVMU2NM_6n19Tb!`TvgS1U8Qk&tDbn!$wXpX=6ZZKt-o zq>N+0J1<-#zvMv1VPXfT5rzDr5@vDQ}>A#9bZw;Lo|X!x{7&G9s&*~fdS2k;(yG) zk7Jq=#rxP4mCDD#pmt!~0*A-bz4G{w99HnIN3lqehX!=uh*(h{Hf+8a#aHd}a9=ql zacot^8H(a-q;jbY7B?+`vA!T7Q*;31!akY}a$&9$W1vh@A(Ej8D$KKfo?@`|2Z!D) zMdh=?zI9(visFNgljljYP$>8cexGR#kaRd4CMkww7y@b#_L$*_MZ&OKs}=-c%a)dR zG}FK;7DdS%b)q-3YZVN0cV|ZxMaYJK+|poC#9_gdM|EI0Ng;~E8=s;nJfli7kW`V7X$}x! zI=~SjDohb79SSKbQ2ZQ4Rqbqsr-cy530y25ip6L;5$IvqP&^R`QNcLp=Mqd6n>1`k zG-OcqtwG=G*zg^(eB1(}V_LnYIb7|6%%JI*_Mn-^;_=n0V;y~(p_m2x;Yyj-q85Oq zodC){%ha*eJoDNn9F(BnFUd@hpaZN#_^AL)LQqs;Z%L98WLZDUu=qM&`M>!iAt|!b zEdObq>JjY7%64NEps+DazDJ0h7fQHxqGw%S5dE>H z+NFgSCD?tdY3kgM*{f<}>&g1siMrXXe=C0>_k4{?WXF>&Q*UJV-u-E5`rgx@z52k? z!EW!V#dCK_W5=J!OnP4G%+RmpFxTSt+~WCC?!s=*Pbl5)8A;E26P_FBNX^vT@hz=S zpK28HhuR~T2T+>aPpiud+V>4a*ap(%kQkXU*X+u@9am(o^M}JT;C}-Z?~fhXYOAqm!GLQSekzEzWSb0 zZr4%liZ@&P)Vr<=pMTuZaHRX^wmHwWN9qjMNK3=p=&~M3Y%hQK<<6-;XMS(F)Yv@L zhc54FV~=Fmnasu4(YXg3=3UF_9?!(->krMAFD|!DK9@O$5?cJy_@T~z@8$E`e%LaB YposQsFJ;R2cng-&j0`b diff --git a/OsmAnd/res/drawable-mdpi/map_compass_niu.png b/OsmAnd/res/drawable-mdpi/map_compass_niu.png deleted file mode 100644 index 5207161498d702be60ecbe7068518b5430ffdcfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1225 zcmbVMTWs4@7%<(ObW2;$7?UV&IZAdc~5TN;T+?durp6xbn z-`XP44bY%GAkctKLqec|xCt>3AhCd$gc!;mV7!2)3B+D_9TH+3r%BmEwFfNO=ltjV z-+%f3|M!vd_ydERw{0c}Vz9Vht>ATQ{NCJ$zrQweSMhRJSg3`Q$O;>p4~e{qbO?%$ zHU%qCGv^PVgF^(-GiO(8VXZVK8^}p%u}&&-Jd7rYq2b8WjA-PQyA5JceSB-^fLo&(XePAe(u>l8$8i<@3H;|(o*|sa=eSA!lpsf;4 z=g767YNawzkPm^7%1{QwrhzD>SRo@y;$FaEnP##y$54zU3%ty5p!1N}n{QfjMIG(< z!cvZ`hoL9abfeKoHTV?rr)XA^B%0x9j-#*!70kP#7Ex}nqiaEhf#KU;Xd@TI7BwBs zhB*>Px|V|Dl}hV|-JnAhri_j>k7iR0?Kp8>ZS5ee!2iP7P&=s3dyuZc0L}Uau7|aw z3&z~t*io#Aqmd_k8y7{JQIRq0KsPL^ITGKbOxu(>OE;iyX_Uc=kdoN6NM#v`p)59= zH7#iJBExj;Y=mc3K@|(5f|AYWS+tc&;5NfUgyS{DgyMs;N z5GyM_)I#J}5t`|CLAj1X6x5Li6s28tut;p}c!3kh4&MB~{LwflI&PNhnx}h&J2Kv`j{+9f zhY7lPf_ywG=DA;5c+CDNs`+a4v;OzBYr{QMVoT3+iGjO&&!7J8`7@{QAG&>oU%X0> zm9PA?`|ZC@+`2Nkm_2q!{*At-P@dzH_dRrB(7FNR;Fjj&*~_2i50Aao`{H7ac=|X8-Gp(B<4<0Cd^xmO6lj6w5S8IOe zz^XlvME$x2o+u0q{G%*iNhF`Su;L diff --git a/OsmAnd/res/drawable-mdpi/map_compass_niu_white.png b/OsmAnd/res/drawable-mdpi/map_compass_niu_white.png deleted file mode 100644 index e88b091f950a6731b6d09443ecac34414d444cfd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1230 zcmbVMPi)&%7iGz1c8ijZgvCnO{eXbOjkF#*RSO)Af6QaDsQV99>( zd++!A{(oMX7(X%4f3Tk*h=Ke`wTRazg10Y>zjtb>O}sqm=gR&hs`xeFLLy@z4U%~a zOu-@q#=`7(aD*U2^Jb~+mkZA+I={umvXztLDi?7fvpYm-NMHT{fuEXUUPef)!ZM2V~uvu|1`pqS|^Dybq2Uiflvt z=@hl?RJkxgW|0d?F_xfpmJ>)xj&Wi_lBHuLk7b5UGCWJOvLeP6mM1$8g{`?pMJcLd z9a~sRQB~h}6o#qQYOz{8hTJKJlVzDp_J+C|ROsoh>G&qH$v`8} z(43#5u&3K0SWcm^quBO3iNYyk>cC;R7|U2z5LX-R`9=7z8@r;t(t-n-BJ|LltK)i9 zhPq^&yN4SJfY=-5v}@v`fEg9(a~8Dyyqco$P0TP2g|BEj)GC11ISJA-CrEUXm07yN zC6h)48gYqbyLxuxOX^sTjmP6TNyu_sPB<>InM|C|3UVTz923ld`RP%;|GHpk#Lf4#!#+ZvNvYlte z+{K3k5cPzR)M+uninOQ+0LRZtv@A$Ca=-&#s8Aig@qhEjV5gX%S^m>J-6PzQ!FFd9 zu&^^s(8d$w;!(Nx?!9Yx%>Kx$nNs~{?ZMX8Xo&9lb?Mw+8*6*tS?_O7Hj;zOTeo{Z zzV!a>YagtrkG$D4do+4?|MkX!$d606!fSR|JM{9|Z~B@y8gGZz?uJ`0Ow6v9FYjs2 zSG6C~@2LZkry92+ub-EWTpGT4fsaP+TpsLg4Q~oJq9D_E=@^)qU$L zpQXR*EgU>{__f30mDa^C()ZPMQVX@_(x04qCNfWOqfvD6=@(beMSGfWHOk@TpF-T@ zH|fp3=1b`Z2bRBY)MfgO-v-Hj;TB5YKXLsP=dtCXE5C=%8lM-^=Q&|@SSN{Q_&m)^>EZxoRsEOPNo*RLEKX>&rHit33rwr<&vk2B+o|m~ zXz?x4)PTOf7s3zF(&ff;?h#9K3z7}7sA|a& zBn@cXLD{Ybx2SwgOtiTWYNeYG=}x{7xR)b23;V-5#0>qe_g(c z16>W{$G8-o%E#cSJ}_g$BQt|pWoAs_RlNTN&{q_Y0Ry@cC>rCYBNW4U#jb$%?XoBVi&M(kDu=U``o2_a> zMoet^LQ)tXb=|x`QH4T*Eci*w9-$bX=PBAp`FsS@Ae?E_m5PMvc&ipf=qR?HcXi7I zWs8z*O}b$mG2INo$fr`~tPd8R%G( zwu0)Rd8=TQyGJ`JDP}U?uVSx3%NRL{s<&0W+5Q|l+4xT%vo2pfC_Ls}F8MO#)eF~}x z+cH2U&w{=Khk(Q>0XC!%T!7{XPG%((KOH1^Hi#mZe3FmV@GZRhfAdEnQdGHF{?k0w zBh-=Q?e-`jVSAXMi6+QKqtZRR?@tV?Igu2j+2Swq`o>0o9Z};YTRwd0eQDQJy{v&d zCGx4sdmTre+(7=ZU7kX8?L=h#R4%nRHwprn90m)|TpL=%+JKo@3C6CS*P;Q>ci#K3 z6#D4p&ZgQ4uJe8~==|i(`l0l}TP3XRWby*m(aRU_UYyO9+FP39&pz+DbY`qn!|Ls| zrz7Ks7V19`m!9xu37voV@b22X=~V`Nv2^Yp?fG@K_cZ=ZBfPcpb@P1P=hqt}ts9RI z9lTKg~9OJ$32%@Zw}Wij@(GaxyX9m{OwYxKH1kb&y^l@pSu#dKKE9nZ}&|T zllOtuhLxG~KeOPgQ$J$zJ7a0#aIHK6$kNiur#-KMvyJma&mHd@1!lS3^9QzaX}Kr$ zY2@{m4)IE4eb0P%=HizPahGVn+SZe}z1P^!t_|0~)1KOX$M@rU&Hi$8r^JidFm a7OQE%W{*Zn+Iy+WA1xUl6hAxg%G^Kl6uDXe diff --git a/OsmAnd/res/drawable-xhdpi/map_compass.png b/OsmAnd/res/drawable-xhdpi/map_compass.png deleted file mode 100644 index d953bc4d09683a510c7112c300f74478cd29ec95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1693 zcmbVNYfuwc6b?^;jEW#AI*!W{<)NGGCgip93P~_QLJ`seR)kG(J6s)E1d>)KIOqQw4P>RxK^osV}rJI-|AiNH++!KOBE_XLj#B_nz-O zzH`oOeOBiB`9aHqI2_J=twxp2uCV6~@Mpid-cR0Pmk36k$K+5Z#);Vpjsm9)1faEG z#Y8rN;pJPuBN8|qpE6RP$K>fUP$OmGV;&v8%VJ~E98N;A%Z3?C2nH|^#iTV6oIG|C z1V}s)%oXckolQxYNlk^F$f?NG8!JkTavV%f0uo#(YrsM<7~ry$T4~gk2+r6=*}dmj z00J{AOi3d6ET}wP7NDf;1R&;1AR~;#15!C35lf_U=~_U@$^uv>5W)~FN5vu(76P*m z$a=HmCNx`>HtUO(52&g)B0gm=79euDTmTCNLLtOzKy>5|I43%4NBl?mj5)*+!5Q6p6&BdV1?(yL|EAgva_Rdf8+K74#)erR;AFp zuHO4lr+HPe`0QjQx&MRwgpf7CpVl_>L*nX~C3W0IVDM>OUSq~ckY93TYj=p&9MEl5 znM3Q>4AycLUw75=pzcj|eqd_QvZ{hOJyh;r zdaXaBzl#`HC2OCW7@Z$|s<3)AZ(d>BzRP!)$M{3zP4x$}ILswS^pmu}0dCOkKhYSG z)*W~uGM}r+@zvLCjw}n)?*Ybn=0@A3Tr*POR=yv0eT$^$QhrL1xk0!;f;SP@<&Uc( z=s^8M%=lV!-PY15%?~GC zb}MPW`hG8`HLkOPwhAr1Cjtk&f1kebu=jTLLv@O*qej!GN=J5azn%9R|NdKHyY9t? zOB&q!>=>@;mUW!JId;=$<>Ku=zy4gH zSrHKZ8o1514_%t>yUllJ>N)ML$dr8?Dzs=zOZBNxSLZ`+Pw1k?F`vt_9n*V+BO)*E zczf_fSCi^X@se=Ejq%2n(a1W5Q=YsV4Y`Ph%iB&yE&3$GErsJwU+ob^9^qZ!pH6c- zlaFldUpj5C3U{o=A8~N|(^ec=v!u`0zcw$_5#w41U0MB04Y4Bbu(faSNyNxU!Rx~B zw4Gc~!NkVqx|c_ernCo{$mR!!7JhMeq{ZboD(iH_bX*kwRoQgxY|FH_!Vi!#K9MFIM}Nvbl}ikn45sZTE1%Y4Q1z9{sl5l1Hx3&1^4vGm vhfNRO4RMz?96nDj?8N+@P9JR;E(6@0!6Hl8hT&Dio*#x*ovAvIT2%875i@3n diff --git a/OsmAnd/res/drawable-xhdpi/map_compass_bearing.png b/OsmAnd/res/drawable-xhdpi/map_compass_bearing.png deleted file mode 100644 index ef302192a36fad15e33cc1e3571cd9dbe751b2b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1690 zcmbVNYfuwc6plO;L1h5Nswhj;f{$c3FOn?8x_LoFFhVG3p~EKGkQ6o>cNYj0l^Bsy zP^wr5upNWbI#!F1%G4>S_-Jc^DKerWR12*d_`!&!bV{{IHwd;r9Dj6YcJDp+p2v5- zbIxqJHYskd|6+d@i#1mhuS{lE$n*NmWWH%$f0Z%IB3hMBrw}H(03|UNVkGn!puy2> zEEz+Mh1*)OSQg7W-=a&W(-Sws1_I}z9v!Y7w=vc%R_t4L8*0eGXh4r;TdXqnaB~YA zuoz|RG*KdyXj5QjOMDTDr4%LU3`IExsgeEGIv~~#GY)W!MgcpXYo%bjj6LZWX7-+A zkPS?#&^a>p3sC8aT0lXN7$D+Ca|{qq2#BRzo+w%@6|V*Oj0{2&kPmSnDJ&Ae5FeO& z*i1CiXo8cK>Zw?aBx9Rt+6IGQK|ukxK)@x)Y>+3FNBsGi89Wo!oNixhBMV&Y53R%(hUhBDBO+CUx`0&(1v*Q7Q@Cu9G@ zc%?R_E3{!?GDZ=3q=Bi2Y5BA7=6Hg*BnlPh43_;U=US+S6sCkG)Ay-HcDUYWTN)$YX zLLOhv)C5uS#nZMLD@CJL12!Go!o*fd5QRd{7r)jPR*)D<6QqtHa;LjMYbI!dG7~mH zp_r^X5S3=J8i@jGm8VQEvQ}cGB_A`YNdgBZd4?^oz+j9P2=oSiG>0b?={W*O$dC|? znwZ|w>y6POkwC;3v8U{f|Cc|I0R?)RNM=-?6&EzH zSYAyUC8D$U4%N0NEZ7`&edqO@w#14-NBN5T30GA`)r*67EeVoW@ON3qKJcqAlWlA; zf6QTTLmTn^508ZgJ)ePx6n#@MRNo%D4arTd>~pr5zp9mHyF2d1D1LVazH90Ta|@_t zEqzgQuDPP(W~*ZLj&$HgRH|sO>ENF$T6`b7yRMv@y}41`$xOYd^Xr0kRjc92U_K` z!)E1iPxnMr-#_D5X}@5t>8d>H-{=^3-^;w2KRB$;sovR9s|U^C*Cmg-hGX80y2$A~ zKTuJ!R=2ew>B}pl7xL9wRdP>UfSG%!1g}5v&WaPgyK(WFc)#IspHN*rK|9Z_1jZlzqFdn!T z(-0OHiJZ`SIpOBxe-AyiwYiAC@;hm(pN;CC*n@1V)1Q}r9)^|sro9(9~>`En`r z=u#>`S#>05JCHz5^hW58bf;~vtuFn+YhV;n?HiDHTxfpw$IPeRmkPUmtCl!OuF^lq zyXo4kz3T%PvaRxY=QYsqNK=EWdy~UwAprljpwi*Yib;EKRmb7SPH+eJc9U0TM#*dJF0L$DbgK7eKkNL&!_MqFvG|d@KI4nr3(zlBDXq&y|h+Vu~Q)_$G< diff --git a/OsmAnd/res/drawable-xhdpi/map_compass_bearing_white.png b/OsmAnd/res/drawable-xhdpi/map_compass_bearing_white.png deleted file mode 100644 index d8d2dd9fa73b5a38dcc41b3d7a8ac89cd8ad0515..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1690 zcmbVNYfuwc6plO;L1h5Nswhj;f{$c3?_?p?B@c)QMhFEhbl4;tlEP-=?gD}OAV#DV zlq%K%Y{%fVj@9C$(mDkdU#$hE$cTziEwpOj2P2l!Db*s~AlUwJ{L!7+z4zREzVrCb zIkRQjq`2As3;kIv)@)6@GMQN+&+9jx`KEdORmv<2XjM9$LYU|Rl*Cwwk^;XI z8<@cwz$M6RkSCMLK!^|W`5Z=rLls(S)XuR|OQ$R- zG0H$%Y_x^20v?N~p2(x+Y$nndDd4um#FvJx)Fe?1WuP6kfjlk*;!81it;N^6vIHgm%@T8uE? zq&HxC6Us60Bp64=6G}KzNCt6CJgL-Z!i)k51Wnm_6<#G(^AM>*t&k!z9#18dDtHWq zJbo-w6GX+AOkp)vibkylY|6KV@jZ!Ey%q~ANDQS3Qb!QEQ(d4n6Es1Y2^*kLOjI3+ zO0!svL;GVLD>2fNj~Ue@fddmf!(>zm0OhhlUX2uffERU^xGx8I9a{O$~V*VG>77Enu?d!uGu zbw$O^RK@5W>A;PsRM9}=fj^fu`#yGeUOqc>V}qoFrAAV8r5%3b7lKrdS<=?#Xk^sa z4YI&HC8>R3caNFRP8%uR=&Fc3m6S2<5gIZuT~v#oKsHqStg}BLL%QqqpYDasG9yEjB6hG=5iheWd0;l6#e|hn0 z-RAnFFE5Xr&sS?z$=z`QX70gayl($H%Z~T#!X>NX{f5STR%maOe2B$V3kUkaBj4Xw zF0OCAILDb;5^Bpp*0hJn3(pKAz)ulTRpekBb@@T6>tMj#>($#eLP5fTc;ISueOO#1 za$M`>gqx22J^0kt>LPl}?xd}JHlllC53;RHe_r-^xbi{e+is_N#Bto^%camGi>Ux* z<>8!dKms}56QMiYmA0*>s^kZ+{t-mAw?DT1eABZ(ra$$*SlH!TxyV6smHt8AjaP5& zSsOT?ZH=9CP6G`MH`cqlHaL9d1MqM2Djd$N=(P7%v>$rx1h;c@e)U3TW9=X@o(>w&{pVwh%-Y6EsYt!D!;*$ZVD{$7GY3WzndZ7(#{!bMqrOd0lQY_h9t<-vlXBfIgZ8Oo zLJ8JYq&AasBdBJl3s?ma0*y+Gdq}Dr=nN`KqtzL7&jA|A1gR%z5+@CeM$M2k*nE`8 zo5*{a23z%}FC>|iK1m8O1QCr!RZ+D{5L*e#U@#CQP0%!sH1Kd&P-0_vFuW&i!3M(~ z(I1lhLJ*`ZvYgN5^}HAIY8^?Y?QDm)>n&Dm6-`?876V1u%k@?YQAp8Ms3sOW ztxIDa!LY;zJuvOtk9==nsp>~!8LJ3cNf6zF(4OuBmrsy{uulj9t98BVV1JW8$P3Z% zfmE3`vbI6dAAx+eCZ-1qkL1En zGCy2#tzcz}uPn7A-ncH-U8A(lwXnG z_447;y+`9fK7j8S>*zgO*Ly=&J9DeAXeK8~_fE-1OR1d0cNDTe-dd2Kl$#w_&e=>O z=3%nP2p&tC_=QCoH@Hn>V!&B5d#`)c)RTL=C-&sT+q*t`g|mYZ-E75u%S_*Qua&$pe>_swKQ5m? zyL)Ug@x9M^*I=ENee7FRfEy*XCG(kci_I&&H(kq<-M)&o;xk1R_&pg;FPDK+S#y_b zxNEa_kKepd$Y4p_$Fb&NjoXN2PPuv8>wH*5gFMjYp diff --git a/OsmAnd/res/drawable-xhdpi/map_compass_niu_white.png b/OsmAnd/res/drawable-xhdpi/map_compass_niu_white.png deleted file mode 100644 index b77d248b8e5cf252052bfeff652c3a7d61589325..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1421 zcmbVMeM}o=7(Xad2JOJ8OQ#DQ2e{$9-d(x&+Ow5HKei%;4#;53LUz4-OAEADt_Lms zWAb4J+r(rpG1)@c$fBajW|l0@M3*hIBjBcM+?)g#qiA$4>I`PMB}9A+6#awj4==fU z-{*aw-}C&QuRG+a+o8^VHWxt(7TI5F2Cr3F6AXS3s z1*j{?wSfk}3B6s@z>FY@oNvQaajLFbvTMVy=vZIlcqPs28*aLKf`) z$CofPAXuN&wYs4LDCyG|HH?l-|IYm={qUlnK&E=t!J2vHA*@)S;^n z2E9pwk8Q9!SA9Xrg85}R%o0R28r4QCw4&5TP$rX!Aa#UJheHiK(i@Vw7#@n0q%GJ% zgqH$gIUt76lts=fcFPtFGF=HF7rs7)Gj>rw*UmELb zN1A%WfM@^_v0LI{J$xl;FwEWK9iH{)F#tDFG=m#S6N&pMqfzhyp@JdFw4L?v2CAB*E1U)gL)$3IK^tjJok|I*g@}K5OAHj}HZP!Kt3TwjzLU4j4I4Uok^?r>Y8E0Jfs;1bicX4T{@>5TC zt;)9L_4xi%8F^(VPVPDW{jr~rx%aH2xrwE4`I~G{dvemMDA=0O^}DCGdeXX21ukTs zoA=Bk+Y4?~)r{S-nx7lqJakz3S^o^;zW(I!&4UBV^L-y>5A9f#Tu#J>`hf>bi2=ZW*(V zk{UDmM8YE6`%U4U?q9epqnpsi576^x=c1dO#rr~! z`ezFtj@(X+RopUrj!fof%>6q4W4{*t_KmVijry7V#i0-XJXw6`+)Z6&5_{@W=A0k> z`$*|KwV$_YEH&c_>z#q;H)SXG*sdzjr0PLVoamg2eMivc7oFGgZIcRB^7@wgk=;LA z7nIhk?SFX|ket5BSL#(Dzwd$Q~M7rkhP9*&A9=N4AU8s3*c|tj{0m)P$ X#U0Mkq7Lt?sUM`vQD;9}y?@{z6tL)^ diff --git a/OsmAnd/res/drawable-xhdpi/map_compass_white.png b/OsmAnd/res/drawable-xhdpi/map_compass_white.png deleted file mode 100644 index 63c12217009fb6d20193b16805d066a334704327..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1695 zcmbVNeM}Q)7%#Q0e7T{3;M8#(#8|PtyV7q!k$y-Gg$fmFWW?+B3JtVZt_Lm36cDDu zaN;yhD5%@~z)VHs7!Dk|WkY9lZe%LRfas7QnxQg5Bym>+w?B-3?2^0pect!^JQCu;LU7xU6|LhujqhPT7^yd(SZh z0#hnfZXEcEltHTl6a^PK)JBR`jqw8Ugm;uwdd%Gi#BF#pgLR#pepm|CHE3o1=N~4Se=^MVuVv-BY zMhrKaQ67d!aGneiN_bLO2J_5_RBAHgrf3Na&)9hrUW_Eb!f3TXB@rqRL?x68#VVCh zjUZ}?NFqbjGgytyL7_GbpYd&>eNSVNw_@cA5=SY5)DuMBOc&^K2#Rpz5OzSJn5sIk zG{a&u5l#o!Q>Ir@D{<0Nh?~?TVFjl0EVsOg11iGALMg@*iD3~>WE7%w{IG;46H4gF zQ2{Ctn!#zj>Hp>rqDeuXX8BL^%pB1j>Dj&>1zLDLOt_7nAd()HV(&d;38<}SCAXx!`<<<-{%$H;jFvrqx12-!JOKA2L)@uxmCbf zEz4G(6MQZwygamJ_xBZgzeWH&4ydjTI{UqE4cD7{M|(dUE1SJ#{Cd&Yllxfjg)w)u zI`dXRUh{G6{D7-|PIAd`e@pdg9c%Py!O9ouK2r9H@d@vo zCe6k9H;x(n)^1=4xA}4l1B6`w5E7ZzGwg+Qvfb>*L1WKK%daqf<5$-r^+2EAD~hn8S_ zXGe78&qK{(FVUgiLHAdseqlVOjh$J>xwCIvKB;@BdKIH86$(iRqI& z{HFgU)0xEOwwH!;Z(gtWJ-fK_Nq#`Fq%kT#WHO-mfi80(ccL||Wp&tOgT=b<;KumM z4_MoS7FT&~srYzayg2E6Lx0+_yCSGx^o443-!HW*|m~&jIM|g?vEEf z=|9s~QQpU#UtisReMe)*o+0MthO!0RXAPf2?_NR#Y_q>yaLE+pK89LG5n zDbzY6(n9F55GvCaq=&X@X}tg)+k#grTA3q`D2N^qM6eELgJAo^>5uNr?)Sal_dM_Y zo&DF=giVxyRRJUtiK2{GBoS-8`}Ol7zS~ESZz7gpJT?VSM)kN&V?{_Z7}X+x(xgd8 zk`N7?oAo0SMIw3S7}Y6wifW5khniR#H-=?5SqL_X6cuf^Xml9}4rq~dqgg_Kc%p+2 z7-0$hErE)yvd9sGF+R_VBLV*dvHGtieX~x8M34KnlnAp3I zK{_x8!80WE=T4=lwgPh0iU0zZkf~#H_&_AY;s}J1P~--HOUNKw1ajF-HY67C#B44w z|Ii6*R#-1iQpC;MA|wgjfa4Z12-<8mmW{_kt?3{Kf*_F11-V=%fnZ{}W?W-unz6MD z8Waeovl=b95j6vDjT$YQjZ5f+r_Vz$SyZYQip|)3qKK4%c8vw(u-Kr< zP@^Y$ORI&20s&9J70~DT@ZZfJNH_($o8?c@-IKNaR z6BBq{sgSAd{r5jY4F|S`cJ-V(qkm6-;rI7~mTnuSeR@*1=RUb=1-w+5BEKehAp9v4 zd${Dsx|2HMh)ig23J0v`X^Pi*eln6GdY&!J1{x!fBuC-;bW}jxbOd0lQ4a z+Fuf_A%*6H({PQaA;dr{tfln7>+$R>jY1Ga@8`2)Uv#E zk;`9wdhAeT^p}o1dxhzY<79q>%h6i>%l?Gf63;g8HtzY>W3GaCNc*H+So5WXNly<0 zlhJq9wDbyZb#Hf6=Z8B!L;21yXYiTke;gbR2{deQz1p*qLhXu|K9wyWFE5!K+2YL) zYTKREETQ%=q=&iGH_Nu)*9YA4aZWo`ALz6va~nuvpY@fY%LmV?NNrSg6C)@5Tpw*o zgOC5YXNj%^nc8!gZyCdfTA$PArH*eZ3Aws?)JQf&xK4*lgD%$!9h<|CQqL%5o3lM| zlKKu8$OId_oJMErPa((Z9~V+w!Rp&fo%DAH+8s2(lpaln3nhmm8E-U99`v~@$tRTHUD`UxBn3TLH?w*pe1U@HKc8` zt#wa>VR0JS+2j0oz<66;uc+dSef?KnuZi}}V{$Hajb9;H*pBwTu;{xXw$_-LPOOF2 zSv-`SNW|(ly2@2ExVxvd`1;EF@r0|YQFfR|c<}7y0@lN0gXOa~zp3cIuxv@cyf?K1 ztO;8@0S-QSP_p{#svAwh8wc0iexk_NlW*HvWp^&FJ{97qEn#I9e3IICfH*o&?emiw z_Dcsu8ygFsUU07cXnf$>Y{a9ld?yy+M+PzR^sC|@vdV4+lNo}W6Mmgdm#@{2;iIr* zZI^s;R_pTLYlkBV1X3=dRADOV8i5uy(9|vrEze-WwF!jC=sc5Jn+;=t2F^f?Lh{dF zw~+xvCnTppQc!9V!@6lK`O`>Kr8{s z1YSI3+?!da7bHtoz3_!gLUJaCnFMsY)oP_#Sv1s~L1*y!d^*UaGnrHzLAB%?F?Al* zXjwjMK>}N}X2gUcs1a~kRBO;2Oi0F=J`cfQl1g71Hd+zXdvBSaK$x) zwqVKd?=)VCwkY#WFg+QzpgCqOUJw29S!FzTf9}Wy#Mubeni0Gx>Masfn`3~DSfWHo z#&2jkL?>YCHCkAsS5vhNE==V!*jy?PI%eWSdF1(C5mpD z?E-lwilLTF)C7pdGgSvxq##BeYPGC%mFaoZ64;F7!n##v)Bw!nS%AEPgO0;uX|zlZ zmBEHIR2Im_lfY5y@!ryCbQ}m`K}?AJLSOe+^GC-?(Ou2*hvu0*!aLHneK`ua@N$@7 zBR)Z9d{q9?&HRl(aQ91;#3=J_jUCvO5U2>e)O9!h@p?*7b#+2Ruf0*R(5BJ}-D@f( zJ6DE=)o-Y2UWIO3X0u%r3&Z@2mpl&i5N|p0HBnDQ`(Vky&DwHdlOfOR;Et zi=!>xtN)D?OM2T^=ahPYgJ%vC*_Un{dNh@hYLpi}J=M&giWtiA*g++&htS*p&R~zr z=+(x){M(xR!f#2bw$E67DVL^~2g^y6Yw4SbpE35ih1C%Jywm$gg7TzIjy063GMdU#x-AUYyoR2%>y@3yH=^wp5)#{NMO^N?f=6kbjo+#>r(UL$%vNOEBRf$?# zNDofGJJ?gy?8v2EzvQb_v=ATUU#U1kP!K;KAa8~ncMr|E-0|Kn?R*G78$Q~hIanU* zJV11AEB&f3!+ZK(R_uk> z$DNbYTqUxnX-$VUa(Y4kx?KUAe7u5EKXLC?ees(;Ox+yr9Gim?D>V)2X*AIV+NYf4 zmXG(4LZ56H?oRVDH`U*2qSor)avW;x)qBdePSOv7H9b&p=(qDv#f>|Q1AtoF!1rk( z4Gm8YrW__Z-~4Cm;{JW|<6hlvPQme#!LxJkg;bv{K|ANJ_>MN9=j?Wm_1H6c{;oZq zaK0*nBa@-P>hk}L7YcTr&58Cs>ZTwb zz2X_)(~~#aR(rnU;B{KW>c)-p?=2M;rhY#*l2J7J_v@@Is669Z!_KEmJJN%}uw!ZO z?2lq(w<)rb>Y#{{VdVnBD1&!y>O{d%pchAc#qiGd)Sozxb&b3VV(G}^cS$#DieDQ`v- zh)JMIJjN}%{nK#n?lqL!a8?T|_+rJ>!}>R&;mPr>)o}|xE%B~no{On(nU?tO_Xd&@ zf+l~g@-AlI-}_b9ywOO?LG@m2AV~lK diff --git a/OsmAnd/res/drawable-xxhdpi/map_compass_bearing_white.png b/OsmAnd/res/drawable-xxhdpi/map_compass_bearing_white.png deleted file mode 100644 index ec3ad49afdab0092dcb8b8935ee15c3cd69da18a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2032 zcmbVNYg7|w8V(6~;U=))g-Sa{pqi3oa+%ypxR@XpO-wLKq!r0!0s|(KCIboJo)QCA zK>xbrOo@G9gZXrNV$kYi76%P1sYUOQ@M0#R=p8N69|#fR-;Oj4P$^B&Oi)8@^9a^ zkpV<2B&R?UP+}CpnMgvu3Er45RcP|FHGC~OItqxi3UC8@7*hdO{dR*{U=@;Q>zGakW>m0jA^BxcN{I{*p(YrBXdJ2rWUv7)pT>YVTs}7fVB#_zO!MzHmuM&craIfKInqEHn#?hMF?y3_hPv2bpvxlZtCl&3Oh)Wu+R- zE9WeTVY9}B7%>Dj04|FvHJXD7$#|qMQ_veFl2?We=Gj8wC8JwaMmmEA()D^*UNhQe zEE)c97_ZefEAosmJsCEmIVKI>58cW+FkZVqcH~mTqY-Q{A$U_%+r_9RM-LmYM6r;J z-_W#(R>0J$HLzNzqG}jin966cxl|s=2dO#+kEhkaS{4@s=j^-=FJ8mrgW@=`h!@Le zFyh#J5g+1n;~+*Xdo2Vq7<1S}gBep9H1M2n1ou6Q75yPrATq%!3^gfGbo<;C$TCq3 zHD{tmKqQ*!IFumLPM{;QNGxw)C%2eD#d$NhlbT} zu4!J2?p$HB-4F@G{EL=74fGK1D%zbGCsQhu{1txwLAoCPxW6R#*4f+ty7N=Py{@rq z0|gWPg99I*HUE7gtM!DPsd=x?Z&i$E1+kv6I>uAhl6oq$*e+=<|KyH*$@q3hTfA5Q zo2Qobwy(=6@c;+U9VN1_+&c1PDkIe(D|~*YnLiaVl;g3RO4P(A^3Tx_mKo;Nn0K3DOIJs81j;#m?cwR z&sXeA;%?!5+8OT+d~8eq^S2;pbL$2-)A%R-%ph|ZlQ z-}Gg8PoM6s3n}~)xPtQ!LrKHiIcYsZ?WGqgfBEjB=cKgkS*|0h*t95X&80WSos-jC z1ya$pzQYnZy{LcV-hiz>UO}m!xpynS{I@+!)g0~|n}-oA)eY%sw3th@&pF90pH`4U zpKTuQPV+G})!%8N*6QAN9BJ&;c}jOo(vN^OJy3Ay4-3!4jXR41fLhzY&uJkI4bKjz z93?v6`b+E5{sXd;Ufpg^!O7ym^Yb5sRG%+KJLj+Zi8i3)>~mk^Q89V(zCE6Bu`A?4|^MDJES$eg=E`sJHFAK>FG1r@udz>Xuc0+wFAc=4Ver?sZ5) zbm1@7{SI^%?C&jXu1i`xa;IsO;#3EmT{wD&-3LS>A_&wiL`eQMlrJ6 z;Z#fPRBxqHeaB zq9$qw55E4p^w@;@bbv8)$ADy+k0Sh`cUCvSck)Rrt*ZTTYk&D}`5{R9nOaUfBYOx} zU5FkkEK_^^bLkDa|-C=9}-`5)ja5wHKPf{Bv2_D zzqsea}5Xf)Y93huF?Vx&Fb4aZ>S#HR(J51HHH)JOBUy diff --git a/OsmAnd/res/drawable-xxhdpi/map_compass_niu.png b/OsmAnd/res/drawable-xxhdpi/map_compass_niu.png deleted file mode 100644 index 1e039c7f47d6fd0c5089c08b52ed4fa115c9ac27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1655 zcmbVNX;2eq7!GOxqo|{Z;Iy(Xj`bkf&7F+|8aJb zBZp4af*PcZIHF_GQLIw6t&Rs(R634!R4f)-#Q`a$f`oR%Vf(}BkM4ZC-}OH4`@Gle zwq*%%LA>ca4u=z@kJlR6Io|gM`m^8UmnY-cDU8vjFo~3zaiBE8QR9?}0Q4l9K^O@X z&->&W5yjz*&b1_^Fe!#5N{k`}s82@VByB93!--nxw4qoQ!2l*A!(vr|9p^59fCX29 zE2Re5VABwpmUtIUB)SrkFjp3a;NZe&Aj+v^6_5mj0!}j9YF9c{;GkY5yY?MJATTJx zWU0U*QYnUIfQF(8Kq`>&F<2-8h}%3)L>%XG*E(q=HcRcy5n2Z{|DGNw)+Rhk>e`vf@+MbkW zBOoJTr*deF&4)Q+1kA?nzYX~WSvJb0w1rIynysa<9FnjydaVj%Zv?mnSBlIgj4+u| zJ|>hCd_*Xb^A#`x^UXqq0yh)5SPsJ@dftWC#>nI%g&Ni<)QC{1lOP&IipX_Rp;{6v zg@wWqtlny8P%B1^*tW2?hpD&HyXi}Jpng+KDOh7$-dpO) z*KdEbRJ&cKAG@Mp!>OB#QVq9msMJNz8uwScdW1a7YdK@P*?9If*4AK;w$2V5b$M@M zEH_xIW=C~-*Q^BxDRP_Z8Uc@cq&r(P;N8mbiuOKiiGDrdi;H0RSHI+qI=#W$G9jy} zt0Lg=U%hYqGb=rxp57QYe<#Ul^_01Hy8?4->3*R8D-H7BiU zrY$Sz-bA10aK2mM?itgk3KK2SZ}uoVflCA78`CTylJRRNw-=NT?D)Q{8|d7zC{L8?52TGs@twcwq~8!}2#OtU_?--lZLt$5t$^ z?f$6g(DAr&TXOe>gmrnd2993uIC177vHzP30S(5sYWzstl=OogP*L5R)?Jmyrl0>K zt)#i?WXs{ohWifn=H`eFt{#7m?RJ0r;&uj4^vn^j>RMCsbX ztlCrJ>fY{d+?RNJegEXu_1`s?E+}-*862U!LjdoP=g#$TKYz}u1E@4%ofq`|3iP@J J?eUm&_uo!6d}jav diff --git a/OsmAnd/res/drawable-xxhdpi/map_compass_niu_white.png b/OsmAnd/res/drawable-xxhdpi/map_compass_niu_white.png deleted file mode 100644 index e1452ce13f44c69fcf8681b1baedf0171ee9e07f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1653 zcmbVNc~BE)6ijCkQOXsguF`Lbx&8!P|l01x{b4fsF!xxZ7 z5+@24o+e{?JfB5WW;UCxpRO{|HWBX85xH#+4$b4m#=9N3$x5<7F1diRtHJ)mjUYe~ zYH+4ZkLVo?AW5&&V__wwja#7#|13x>cM38_D8;+m>f%RBkmmY*)qYJ;yKz z46CqKHTaxVw%!0F&`uJNiDDoVB9;PjrARD`kt^lV0LsZQqJU8ZLX;|*M1`Qh$OUrV zoP=3r)FzGi;v_X_VOfU?hFva~$R!cc&IPbosZ_!U3Zp2*X+TVYoyFadotfgbpd}fT zlX9>WZ3jFS@mxBeRf8PU=ONe}di@K-c4j0|T*_cK?tsN21h&~caSdxTtdabe#!I!C z%mN1q8%c)Fcbd3*n5THbT<%`&$fL-yQKdO4t|)k(mNw+PiRC1u6ielh0#PE6S*%bHW|EM|5yWffWq6rFEKwpFaiUzBAQmS|HF6D#VH!+> zieqG`ROZF%>fykMZ zouFMzl&4J3qt=p6Y7t2!IcXa(oM#pF5)LuA%oHP4m>^jUB7f<4XhpXTu%aUJQ|z8D2gcri?*otq#hH!86{(0m?m)LNYu%XDAv z+t~d6#PqOJZQq{U>%o$U<E@8~ACxRr6Q@a;3_+;V9O#)#h zAgBfe!p^$1efRh5f)>I*2HZGyMG^XYTZ=iv(9-AUIx2SrMBf=V`#as<(S1J0>#%0V zZ_~5h{DnO)r6kzNJamK%9AVoD-R6xbdJXEDLT%TB^xh| zi8u)Mgelf(8owQP{Ojofm-)AAFAga#R*=|)9Bb*|g_~_D5EV2kZRcn2p4!rVFZ{QR zV17Y)=BI4j=J{VO2Lp;)u3~=(p0#I$>IOm&J^bXfvDKQDeH$N(5<%`m>&{L3Ao^_m zpOO^pVF&M42(hLGZSc(xA>O(hf1y6IDYzmjyc#GZYBc`*OTFz9LmHNPL=v{%hV1!u zd&JsQgZz=*V)cbs;5llKUO|f=C?KU?6{zTK5bXWo^pD$_-S>Uo z_xF3gpV_xEHETlWM$QEQAXJs1)KhDQ{|$MG`mP%}wT4jbZ~pa*E4_poJI-7GRsqRw;Az z+yy3RHb|N4g=$D`Q(z`@#uhu4wMCPSZYe}124>1?FxdrD3M?3jfG$gsm4IDR=Codz z+WU_=OmG@P7D}1VoXSyWf(qP@fkJj73x&7>P$Xe2$K4d^T?1#NkRL5)Q=U@OUf=!6HhnB;sOO ziP%{UN{m45W*ce7t)O2cQh+;1DU{1)X(PISeu%lExjIpz1DtEtb$Pc8vfwgusRTQL1iK7k+W+hchDU-Tk z8_WinXDmRm0wcmgxgv}u;R-}7F(iRlMy^M64(_YuilOp5ZEfl?yBE7((LqY#c9|?Sf1bPU3_K zw}A@9bk)I?>&;dJ?j+*w}8`mhRrYVArTRxi2^ao5+*`Imass8 zQ1L?|mP8<;B1d=#Phe!u@D2ZO{y3CV9DlR?PxH(kQ61^uJ|6{2cs@*+m6{+sH7YtE zBY>K~UX@aw?dlz_#!YYQqT9RAw;J~t7rd9VU_q@_*BN!QEkCSO&e(rbtN54jeqvV< zF&f5Nfiw0mQZCKkwdmbNN2~O^^%;!D_{i4VlT-Jc{A+~oyz^1@ol;+^?{6)RnmbP4 zX!YtxXYW+^6F$b;6@TuE?EiwXjc%aTH|b6WxN}Zsq<;`JC~J{-)|5m{1U1sr6&rcwkw_$N4{$vnqq{ZS#&V$-|u<@ zHwRVO%9r1qpWrR^vLZT*=wFAf@)jL_aO3hDUVue!>^wQVc~#6}+0vel=%FUvc^Qx! z+$k*n!)rh74Hm%rxV1a(MTMH;Ot(XZe1Dm|7!WzXp_`vBZR5V$Bk%cZGP-dpH=L#p z9I5(EVN4r;ZrI^@ZSNE;Ja?et?=%z5bn4~@i}99tkH#~1S^Jl+;&6Z!xNg<%Jk{7~ z`XB4%sl`vj8?wTxJXg0fchl19mW%)k^_#EnJe^sVOY5aK*yd!?Pag^O>gU9_W#}vQ zdBBo@s+kRJW`55zD*7yXto1I$cWnoRz-M`ZvA& zRetr_q_j(y`}B`TH-% zn{<%x_1dlDC5%EKbY=AoCI1R=dUVMAWJz7#iS&l|PFy|k`51BzcjTxBTGq$3FZv3t z%1b{=#tosnAO5fon4AY62en57)z`;Atk1KYoOs|By~=kdT=;09wZwP#Ve>$+dqDHM zjD8pUYS;K^`Mo-6BXBS;&_R?(*!U>>+xV|4G|4)cn?C zP04}pBWWQcA%juvcbf1N2DvxuNz%_x4J{8necOHZa!p){GEVHvOg;qEUi>Kkb8!`% zB-nra<74X~wt4>G9xyy+>*TR*W7_>fU34t%pu>|-l)IjU^(WuIKK^MR{r#VZVDE;C zz0ukeee|~%d^Ts?41-NkUN&u6TLYvf6ylHRh||7)BW+C$c;78(D)^PKUUlR?>qMP4!SM9W k1FN-_)MQ1N-UwO@5W$~BH?&`W Date: Thu, 4 Jun 2020 14:47:59 +0200 Subject: [PATCH 24/26] Fix spring street --- .../osmand/search/core/SearchCoreFactory.java | 57 ++- .../net/osmand/search/core/SearchPhrase.java | 42 +-- .../net/osmand/search/core/SearchResult.java | 2 +- .../test/resources/search/spring_street.json | 324 +++++++++--------- 4 files changed, 234 insertions(+), 191 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index 2b9a6437e8..78eee8a6f5 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -141,18 +141,51 @@ public class SearchCoreFactory { protected void subSearchApiOrPublish(SearchPhrase phrase, SearchResultMatcher resultMatcher, SearchResult res, SearchBaseAPI api) throws IOException { phrase.countUnknownWordsMatchMainResult(res); - // TODO select word & delete found words - List ws = phrase.getUnknownSearchWords(res.otherWordsMatch); - if (!res.firstUnknownWordMatches) { - ws.add(phrase.getFirstUnknownSearchWord()); + boolean firstUnknownWordMatches = res.firstUnknownWordMatches; + List leftUnknownSearchWords = new ArrayList(phrase.getUnknownSearchWords()); + if(res.otherWordsMatch != null) { + leftUnknownSearchWords.removeAll(res.otherWordsMatch); + } + SearchResult newParentSearchResult = null; + if (res.parentSearchResult == null && resultMatcher.getParentSearchResult() == null && + res.objectType == ObjectType.STREET && res.object instanceof Street && ((Street) res.object).getCity() != null) { + City ct = ((Street) res.object).getCity(); + SearchResult cityResult = new SearchResult(phrase); + cityResult.object = ct; + cityResult.objectType = ObjectType.CITY; + cityResult.localeName = ct.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); + cityResult.otherNames = ct.getAllNames(true); + cityResult.location = ct.getLocation(); + cityResult.localeRelatedObjectName = res.file.getRegionName(); + cityResult.file = res.file; + phrase.countUnknownWordsMatchMainResult(cityResult); + boolean match = cityResult.firstUnknownWordMatches; + if (cityResult.firstUnknownWordMatches) { + firstUnknownWordMatches = true; + } + if (cityResult.otherWordsMatch != null) { + match = match || leftUnknownSearchWords.removeAll(cityResult.otherWordsMatch); + } + if (match) { + newParentSearchResult = cityResult; + } + } + if (!firstUnknownWordMatches) { + leftUnknownSearchWords.add(0, phrase.getFirstUnknownSearchWord()); } // publish result to set parentSearchResult before search - resultMatcher.publish(res); - if (!ws.isEmpty() && api != null && api.isSearchAvailable(phrase)) { - SearchPhrase nphrase = phrase.selectWord(res, ws, phrase.isLastUnknownSearchWordComplete()); - resultMatcher.setParentSearchResult(res); + if(newParentSearchResult != null) { + SearchResult prev = resultMatcher.setParentSearchResult(newParentSearchResult); + resultMatcher.publish(res); + resultMatcher.setParentSearchResult(prev); + } else { + resultMatcher.publish(res); + } + if (!leftUnknownSearchWords.isEmpty() && api != null && api.isSearchAvailable(phrase)) { + SearchPhrase nphrase = phrase.selectWord(res, leftUnknownSearchWords, phrase.isLastUnknownSearchWordComplete()); + SearchResult prev = resultMatcher.setParentSearchResult(res); api.search(nphrase, resultMatcher); - resultMatcher.setParentSearchResult(res.parentSearchResult); + resultMatcher.setParentSearchResult(prev); } } @@ -452,10 +485,6 @@ public class SearchCoreFactory { r.searchAddressDataByName(req); for (SearchResult res : immediateResults) { if (res.objectType == ObjectType.STREET) { - City ct = ((Street) res.object).getCity(); - phrase.countUnknownWordsMatch(res, - ct.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()), - ct.getAllNames(true), 0); subSearchApiOrPublish(phrase, resultMatcher, res, streetsApi); } else { subSearchApiOrPublish(phrase, resultMatcher, res, cityApi); @@ -852,7 +881,7 @@ public class SearchCoreFactory { int mwords = phrase.countWords(foundName) ; if (csm.matches(phrase.getUnknownSearchPhrase()) && countExtraWords < mwords) { countExtraWords = phrase.countWords(foundName); - List otherSearchWords = phrase.getUnknownSearchWords(null); + List otherSearchWords = phrase.getUnknownSearchWords(); nameFilter = null; if (countExtraWords - 1 < otherSearchWords.size()) { nameFilter = ""; diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 83958f46a6..e9d34bd255 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -41,9 +41,11 @@ public class SearchPhrase { // Object consists of 2 part [known + unknown] private String fullTextSearchPhrase = ""; private String unknownSearchPhrase = ""; + + // words to be used for words span + private List words = new ArrayList<>(); // Words of 2 parts - private List words = new ArrayList<>(); private String firstUnknownSearchWord = ""; private List otherUnknownWords = new ArrayList<>(); private boolean lastUnknownSearchWordComplete; @@ -306,17 +308,8 @@ public class SearchPhrase { return otherUnknownWords.size() > 0; } - public List getUnknownSearchWords(Collection exclude) { - if(exclude == null || otherUnknownWords.size() == 0 || exclude.size() == 0) { - return otherUnknownWords; - } - List l = new ArrayList<>(); - for(String uw : otherUnknownWords) { - if(exclude == null || !exclude.contains(uw)) { - l.add(uw); - } - } - return l; + public List getUnknownSearchWords() { + return otherUnknownWords; } @@ -752,20 +745,21 @@ public class SearchPhrase { } - public void countUnknownWordsMatchMainResult(SearchResult sr) { - countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, 0); + public int countUnknownWordsMatchMainResult(SearchResult sr) { + return countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, 0); } - public void countUnknownWordsMatchMainResult(SearchResult sr, int startsWith) { - countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, startsWith); + public int countUnknownWordsMatchMainResult(SearchResult sr, int amountMatchingWords) { + return countUnknownWordsMatch(sr, sr.localeName, sr.otherNames, amountMatchingWords); } - public void countUnknownWordsMatch(SearchResult sr, String localeName, Collection otherNames, int startWith) { + public int countUnknownWordsMatch(SearchResult sr, String localeName, Collection otherNames, int amountMatchingWords) { + int r = 0; if (otherUnknownWords.size() > 0) { for (int i = 0; i < otherUnknownWords.size(); i++) { boolean match = false; - if (i < startWith - 1) { + if (i < amountMatchingWords - 1) { match = true; } else { NameStringMatcher ms = getUnknownNameStringMatcher(i); @@ -778,17 +772,23 @@ public class SearchPhrase { sr.otherWordsMatch = new TreeSet<>(); } sr.otherWordsMatch.add(otherUnknownWords.get(i)); + r++; } } } - if (startWith > 0) { + if (amountMatchingWords > 0) { sr.firstUnknownWordMatches = true; + r++; } else { - sr.firstUnknownWordMatches = localeName.equals(getFirstUnknownSearchWord()) + boolean match = localeName.equals(getFirstUnknownSearchWord()) || getFirstUnknownNameStringMatcher().matches(localeName) || getFirstUnknownNameStringMatcher().matches(otherNames); + if(match) { + r++; + } + sr.firstUnknownWordMatches = match || sr.firstUnknownWordMatches; } - + return r; } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index b93a4f640b..028b3706bb 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -20,7 +20,7 @@ public class SearchResult { // internal package fields (used for sorting) public SearchResult parentSearchResult; String wordsSpan ; - boolean firstUnknownWordMatches = true; + boolean firstUnknownWordMatches; Collection otherWordsMatch = null; diff --git a/OsmAnd-java/src/test/resources/search/spring_street.json b/OsmAnd-java/src/test/resources/search/spring_street.json index b8f10d139a..a5dfdc530c 100644 --- a/OsmAnd-java/src/test/resources/search/spring_street.json +++ b/OsmAnd-java/src/test/resources/search/spring_street.json @@ -11,161 +11,175 @@ }, "phrase": "spring street", "results": [ - "Spring (Natural)", - "Spring (Spring / Natural)", - "Spring (Ice rink / Sport)", - "Spring (Bridge / Transport construction)", - "Spring Street, South Nyack", - "Spring Street, Tomkins Cove", - "Spring Street, Southfields", - "Spring Street, Hastings-on-Hudson", - "Spring Street, Pleasantville", - "Spring Street (Mount Pleasant), Hawthorne", - "Spring Street, Durland", - "Spring Street, Warwick", - "Spring Street, Nelsonville", - "Spring Street, Goshen", - "Spring Street (Little Italy), Manhattan", - "Spring Street, Maybrook", - "West Spring Street, Maybrook", - "Spring Street, South Salem", - "Spring Street, Groveville", - "Spring Street, East Middletown", - "Spring Street, Montgomery", - "Spring Street, Chelsea", - "Spring Street, Wappingers Falls", - "Spring Street, Cold Spring Harbor", - "Spring Street, Staten Island", - "Spring Street, East Meadow", - "Spring Street, Inwood", - "Spring Street, Port Jervis", - "Spring Street, Roosevelt", - "Spring Street, Pawling", - "Spring Street, Fairview", - "Spring Street (Wyandanch), Wheatley Heights", - "Spring Street, Wyandanch", - "Spring Street, East Massapequa", - "Spring Street, Ellenville", - "Spring Street, Monticello", - "Spring Street, Tillson", - "Spring Street, Port Jefferson", - "Spring Street (Smallwood), Bethel", - "Spring Street, Liberty", - "Spring Street (Livingston Manor), Rockland", - "Spring Street, Livingston Manor", - "Market Street, Cold Spring", - "New Street, Cold Spring", - "West Street, Cold Spring", - "Fish Street, Cold Spring", - "North Street, Cold Spring", - "Rock Street, Cold Spring", - "Stone Street, Cold Spring", - "Wall Street, Cold Spring", - "Cross Street, Cold Spring", - "Main Street, Cold Spring", - "Chestnut Street, Cold Spring", - "Furnace Street, Cold Spring", - "Garden Street, Cold Spring", - "Church Street, Cold Spring", - "Oak Street, Cold Spring", - "Cherry Street, Cold Spring", - "High Street, Cold Spring", - "Academy Street, Cold Spring", - "Haldane Street, Cold Spring", - "West Bank Street, Cold Spring", - "B Street, Cold Spring", - "West Belvedere Street, Cold Spring", - "Parrot Street, Cold Spring", - "Bank Street, Cold Spring", - "Orchard Street, Cold Spring", - "East Belvedere Street, Cold Spring", - "Pine Street, Cold Spring", - "Parsonage Street, Cold Spring", - "Hamilton Street, Cold Spring", - "Fair Street, Cold Spring", - "Cedar Street, Cold Spring", - "Flora Street, Cold Spring Harbor", - "West Main Street, Cold Spring Harbor", - "Grove Street, Cold Spring Harbor", - "Midland Street, Cold Spring Harbor", - "Rusco Street, Cold Spring Harbor", - "Main Street, Cold Spring Harbor", - "Chestnut Street, Cold Spring Harbor", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Academy Street, Cold Spring", - "Bank Street, Cold Spring", - "B Street, Cold Spring", - "Cedar Street, Cold Spring", - "Cherry Street, Cold Spring", - "Chestnut Street, Cold Spring", - "Church Street, Cold Spring", - "Cross Street, Cold Spring", - "East Belvedere Street, Cold Spring", - "Fair Street, Cold Spring", - "Fish Street, Cold Spring", - "Furnace Street, Cold Spring", - "Garden Street, Cold Spring", - "Haldane Street, Cold Spring", - "Hamilton Street, Cold Spring", - "High Street, Cold Spring", - "Main Street, Cold Spring", - "Market Street, Cold Spring", - "New Street, Cold Spring", - "North Street, Cold Spring", - "Oak Street, Cold Spring", - "Orchard Street, Cold Spring", - "Parrot Street, Cold Spring", - "Parsonage Street, Cold Spring", - "Pine Street, Cold Spring", - "Rock Street, Cold Spring", - "Stone Street, Cold Spring", - "Wall Street, Cold Spring", - "West Bank Street, Cold Spring", - "West Belvedere Street, Cold Spring", - "West Street, Cold Spring", - "Chestnut Street, Cold Spring Harbor", - "Flora Street, Cold Spring Harbor", - "Grove Street, Cold Spring Harbor", - "Main Street, Cold Spring Harbor", - "Midland Street, Cold Spring Harbor", - "Rusco Street, Cold Spring Harbor", - "Spring Street, Cold Spring Harbor", - "West Main Street, Cold Spring Harbor", - "Kraw Street, Spring Glen", - "Munro Street, Cold Spring", - "State Street, Cold Spring", - "Spring Street Salt Shed", - "6th Avenue & Spring Street", - "Spring Street Park", - "Broadway & Spring Street", - "Broadway/Spring Street", - "Spring Street Station (6) - Downtown", - "Spring Street Station (6) - Uptown & The Bronx", - "Richmond Road & Spring Street", - "West Spring Street School", - "Spring Street Gallery", - "Spring Street Apartments", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", - "Spring Street", + "Spring (Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Spring (Spring / Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Spring (Ice rink / Sport) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Spring (Bridge / Transport construction) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Spring Street, Cold Spring Harbor [[3, STREET, 0.310, 56.10 km]]", + "Spring Street, South Nyack [[2, STREET, 3.000, 10.57 km]]", + "Spring Street, Tomkins Cove [[2, STREET, 3.000, 16.77 km]]", + "Spring Street, Southfields [[2, STREET, 3.000, 18.10 km]]", + "Spring Street, Hastings-on-Hudson [[2, STREET, 3.000, 18.94 km]]", + "Spring Street, Pleasantville [[2, STREET, 3.000, 20.89 km]]", + "Spring Street (Mount Pleasant), Hawthorne [[2, STREET, 3.000, 21.20 km]]", + "Spring Street, Durland [[2, STREET, 3.000, 28.46 km]]", + "Spring Street, Warwick [[2, STREET, 3.000, 30.94 km]]", + "Spring Street, Nelsonville [[2, STREET, 3.000, 35.60 km]]", + "Spring Street, Goshen [[2, STREET, 3.000, 40.16 km]]", + "Spring Street (Little Italy), Manhattan [[2, STREET, 3.000, 43.76 km]]", + "Spring Street, Maybrook [[2, STREET, 3.000, 43.78 km]]", + "West Spring Street, Maybrook [[2, STREET, 3.000, 43.83 km]]", + "Spring Street, South Salem [[2, STREET, 3.000, 44.74 km]]", + "Spring Street, Groveville [[2, STREET, 3.000, 45.81 km]]", + "Spring Street, East Middletown [[2, STREET, 3.000, 47.95 km]]", + "Spring Street, Montgomery [[2, STREET, 3.000, 48.53 km]]", + "Spring Street, Chelsea [[2, STREET, 3.000, 49.19 km]]", + "Spring Street, Wappingers Falls [[2, STREET, 3.000, 55.17 km]]", + "Spring Street, Staten Island [[2, STREET, 3.000, 56.86 km]]", + "Spring Street, East Meadow [[2, STREET, 3.000, 59.81 km]]", + "Spring Street, Inwood [[2, STREET, 3.000, 60.63 km]]", + "Spring Street, Port Jervis [[2, STREET, 3.000, 61.24 km]]", + "Spring Street, Roosevelt [[2, STREET, 3.000, 61.89 km]]", + "Spring Street, Pawling [[2, STREET, 3.000, 62.39 km]]", + "Spring Street, Fairview [[2, STREET, 3.000, 68.69 km]]", + "Spring Street (Wyandanch), Wheatley Heights [[2, STREET, 3.000, 69.75 km]]", + "Spring Street, Wyandanch [[2, STREET, 3.000, 69.95 km]]", + "Spring Street, East Massapequa [[2, STREET, 3.000, 71.81 km]]", + "Spring Street, Ellenville [[2, STREET, 3.000, 73.53 km]]", + "Spring Street, Monticello [[2, STREET, 3.000, 79.96 km]]", + "Spring Street, Tillson [[2, STREET, 3.000, 80.56 km]]", + "Spring Street, Port Jefferson [[2, STREET, 3.000, 84.37 km]]", + "Spring Street (Smallwood), Bethel [[2, STREET, 3.000, 88.85 km]]", + "Spring Street, Liberty [[2, STREET, 3.000, 95.92 km]]", + "Spring Street (Livingston Manor), Rockland [[2, STREET, 3.000, 108.88 km]]", + "Spring Street, Livingston Manor [[2, STREET, 3.000, 108.88 km]]", + "Spring Street Salt Shed [[2, POI, 2.000, 43.18 km]]", + "6th Avenue & Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.31 km]]", + "Spring Street Park [[2, POI, 2.000, 43.32 km]]", + "Broadway & Spring Street [[2, POI, 2.000, 43.60 km]]", + "Broadway/Spring Street [[2, POI, 2.000, 43.61 km]]", + "Spring Street Station (6) - Downtown [[2, POI, 2.000, 43.65 km]]", + "Spring Street [[2, POI, 2.000, 43.67 km]]", + "Spring Street Station (6) - Uptown & The Bronx [[2, POI, 2.000, 43.68 km]]", + "Richmond Road & Spring Street [[2, POI, 2.000, 56.88 km]]", + "Spring Street [[2, POI, 2.000, 183.80 km]]", + "West Spring Street School [[2, POI, 2.000, 204.27 km]]", + "Spring Street [[2, POI, 2.000, 208.18 km]]", + "Spring Street [[2, POI, 2.000, 217.24 km]]", + "Spring Street Gallery [[2, POI, 2.000, 219.70 km]]", + "Spring Street [[2, POI, 2.000, 220.16 km]]", + "Spring Street [[2, POI, 2.000, 252.77 km]]", + "Spring Street [[2, POI, 2.000, 267.17 km]]", + "Spring Street Apartments [[2, POI, 2.000, 279.20 km]]", + "Spring Street [[2, POI, 2.000, 414.96 km]]", + "Spring Street Salt Shed [[2, POI, 2.000, 43.18 km]]", + "6th Avenue & Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.25 km]]", + "Spring Street [[2, POI, 2.000, 43.31 km]]", + "Spring Street Park [[2, POI, 2.000, 43.32 km]]", + "Broadway & Spring Street [[2, POI, 2.000, 43.60 km]]", + "Broadway/Spring Street [[2, POI, 2.000, 43.61 km]]", + "Spring Street Station (6) - Downtown [[2, POI, 2.000, 43.65 km]]", + "Spring Street [[2, POI, 2.000, 43.67 km]]", + "Spring Street Station (6) - Uptown & The Bronx [[2, POI, 2.000, 43.68 km]]", + "Richmond Road & Spring Street [[2, POI, 2.000, 56.88 km]]", + "Spring Street [[2, POI, 2.000, 183.80 km]]", + "West Spring Street School [[2, POI, 2.000, 204.27 km]]", + "Spring Street [[2, POI, 2.000, 208.18 km]]", + "Spring Street [[2, POI, 2.000, 217.24 km]]", + "Spring Street Gallery [[2, POI, 2.000, 219.70 km]]", + "Spring Street [[2, POI, 2.000, 220.16 km]]", + "Spring Street [[2, POI, 2.000, 252.77 km]]", + "Spring Street [[2, POI, 2.000, 267.17 km]]", + "Spring Street Apartments [[2, POI, 2.000, 279.20 km]]", + "Spring Street [[2, POI, 2.000, 414.96 km]]", + "Academy Street, Cold Spring [[2, STREET, 0.310, 35.00 km]]", + "Bank Street, Cold Spring [[2, STREET, 0.310, 35.19 km]]", + "B Street, Cold Spring [[2, STREET, 0.310, 35.11 km]]", + "Cedar Street, Cold Spring [[2, STREET, 0.310, 35.36 km]]", + "Cherry Street, Cold Spring [[2, STREET, 0.310, 34.92 km]]", + "Chestnut Street, Cold Spring [[2, STREET, 0.310, 34.79 km]]", + "Church Street, Cold Spring [[2, STREET, 0.310, 34.84 km]]", + "Cross Street, Cold Spring [[2, STREET, 0.310, 34.75 km]]", + "East Belvedere Street, Cold Spring [[2, STREET, 0.310, 35.24 km]]", + "Fair Street, Cold Spring [[2, STREET, 0.310, 35.35 km]]", + "Fish Street, Cold Spring [[2, STREET, 0.310, 34.51 km]]", + "Furnace Street, Cold Spring [[2, STREET, 0.310, 34.81 km]]", + "Garden Street, Cold Spring [[2, STREET, 0.310, 34.84 km]]", + "Haldane Street, Cold Spring [[2, STREET, 0.310, 35.00 km]]", + "Hamilton Street, Cold Spring [[2, STREET, 0.310, 35.31 km]]", + "High Street, Cold Spring [[2, STREET, 0.310, 34.95 km]]", + "Main Street, Cold Spring [[2, STREET, 0.310, 34.78 km]]", + "Market Street, Cold Spring [[2, STREET, 0.310, 34.29 km]]", + "New Street, Cold Spring [[2, STREET, 0.310, 34.40 km]]", + "North Street, Cold Spring [[2, STREET, 0.310, 34.51 km]]", + "Oak Street, Cold Spring [[2, STREET, 0.310, 34.89 km]]", + "Orchard Street, Cold Spring [[2, STREET, 0.310, 35.20 km]]", + "Parrot Street, Cold Spring [[2, STREET, 0.310, 35.18 km]]", + "Parsonage Street, Cold Spring [[2, STREET, 0.310, 35.31 km]]", + "Pine Street, Cold Spring [[2, STREET, 0.310, 35.28 km]]", + "Rock Street, Cold Spring [[2, STREET, 0.310, 34.63 km]]", + "Stone Street, Cold Spring [[2, STREET, 0.310, 34.67 km]]", + "Wall Street, Cold Spring [[2, STREET, 0.310, 34.74 km]]", + "West Bank Street, Cold Spring [[2, STREET, 0.310, 35.05 km]]", + "West Belvedere Street, Cold Spring [[2, STREET, 0.310, 35.15 km]]", + "West Street, Cold Spring [[2, STREET, 0.310, 34.48 km]]", + "Chestnut Street, Cold Spring Harbor [[2, STREET, 0.310, 58.45 km]]", + "Flora Street, Cold Spring Harbor [[2, STREET, 0.310, 56.16 km]]", + "Grove Street, Cold Spring Harbor [[2, STREET, 0.310, 56.67 km]]", + "Main Street, Cold Spring Harbor [[2, STREET, 0.310, 58.23 km]]", + "Midland Street, Cold Spring Harbor [[2, STREET, 0.310, 57.04 km]]", + "Rusco Street, Cold Spring Harbor [[2, STREET, 0.310, 57.95 km]]", + "Spring Street, Cold Spring Harbor [[2, STREET, 0.310, 56.10 km]]", + "West Main Street, Cold Spring Harbor [[2, STREET, 0.310, 56.26 km]]", + "Kraw Street, Spring Glen [[2, STREET, 0.310, 69.40 km]]", + "Munro Street, Cold Spring [[2, STREET, 0.310, 292.27 km]]", + "State Street, Cold Spring [[2, STREET, 0.310, 292.31 km]]", + "Cold Spring, Cold Spring [[2, STREET, 0.310, 34.42 km]]", + "Spring Hill Road, Cold Spring Harbor [[2, STREET, 0.310, 55.96 km]]", + "Spring, Cold Spring Harbor [[2, STREET, 0.310, 56.22 km]]", + "Spring Road, Cold Spring Harbor [[2, STREET, 0.310, 56.79 km]]", + "Market Street, Cold Spring [[2, STREET, 0.310, 34.29 km]]", + "New Street, Cold Spring [[2, STREET, 0.310, 34.40 km]]", + "Fish Street, Cold Spring [[2, STREET, 0.310, 34.51 km]]", + "North Street, Cold Spring [[2, STREET, 0.310, 34.51 km]]", + "Rock Street, Cold Spring [[2, STREET, 0.310, 34.63 km]]", + "Stone Street, Cold Spring [[2, STREET, 0.310, 34.67 km]]", + "Wall Street, Cold Spring [[2, STREET, 0.310, 34.74 km]]", + "Cross Street, Cold Spring [[2, STREET, 0.310, 34.75 km]]", + "Main Street, Cold Spring [[2, STREET, 0.310, 34.78 km]]", + "Chestnut Street, Cold Spring [[2, STREET, 0.310, 34.79 km]]", + "Furnace Street, Cold Spring [[2, STREET, 0.310, 34.81 km]]", + "Garden Street, Cold Spring [[2, STREET, 0.310, 34.84 km]]", + "Church Street, Cold Spring [[2, STREET, 0.310, 34.84 km]]", + "Oak Street, Cold Spring [[2, STREET, 0.310, 34.89 km]]", + "Cherry Street, Cold Spring [[2, STREET, 0.310, 34.92 km]]", + "High Street, Cold Spring [[2, STREET, 0.310, 34.95 km]]", + "Academy Street, Cold Spring [[2, STREET, 0.310, 35.00 km]]", + "Haldane Street, Cold Spring [[2, STREET, 0.310, 35.00 km]]", + "West Bank Street, Cold Spring [[2, STREET, 0.310, 35.05 km]]", + "B Street, Cold Spring [[2, STREET, 0.310, 35.11 km]]", + "West Belvedere Street, Cold Spring [[2, STREET, 0.310, 35.15 km]]", + "Parrot Street, Cold Spring [[2, STREET, 0.310, 35.18 km]]", + "Bank Street, Cold Spring [[2, STREET, 0.310, 35.19 km]]", + "Orchard Street, Cold Spring [[2, STREET, 0.310, 35.20 km]]", + "East Belvedere Street, Cold Spring [[2, STREET, 0.310, 35.24 km]]", + "Pine Street, Cold Spring [[2, STREET, 0.310, 35.28 km]]", + "Parsonage Street, Cold Spring [[2, STREET, 0.310, 35.31 km]]", + "Hamilton Street, Cold Spring [[2, STREET, 0.310, 35.31 km]]", + "Fair Street, Cold Spring [[2, STREET, 0.310, 35.35 km]]", + "Cedar Street, Cold Spring [[2, STREET, 0.310, 35.36 km]]", + "Flora Street, Cold Spring Harbor [[2, STREET, 0.310, 56.16 km]]", + "West Main Street, Cold Spring Harbor [[2, STREET, 0.310, 56.26 km]]", + "Grove Street, Cold Spring Harbor [[2, STREET, 0.310, 56.67 km]]", + "Midland Street, Cold Spring Harbor [[2, STREET, 0.310, 57.04 km]]", + "Rusco Street, Cold Spring Harbor [[2, STREET, 0.310, 57.95 km]]", + "Main Street, Cold Spring Harbor [[2, STREET, 0.310, 58.23 km]]", + "Chestnut Street, Cold Spring Harbor [[2, STREET, 0.310, 58.45 km]]" ], "amenities": [ { From 96674b5fd3b63b8657818b71d76b556884db946e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 4 Jun 2020 15:33:52 +0200 Subject: [PATCH 25/26] Fix tests --- .../osmand/search/core/SearchCoreFactory.java | 19 +- .../net/osmand/search/core/SearchResult.java | 17 +- .../resources/search/100_bridge_street.json | 4 +- .../test/resources/search/carrer_de_vic.json | 151 ++--- .../search/free_street_portland.json | 537 +----------------- .../test/resources/search/navacerrada.json | 61 +- .../test/resources/search/spring_street.json | 8 +- .../resources/search/street_santa_clara.json | 3 +- 8 files changed, 87 insertions(+), 713 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index 78eee8a6f5..da260b1493 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -159,13 +159,26 @@ public class SearchCoreFactory { cityResult.localeRelatedObjectName = res.file.getRegionName(); cityResult.file = res.file; phrase.countUnknownWordsMatchMainResult(cityResult); - boolean match = cityResult.firstUnknownWordMatches; - if (cityResult.firstUnknownWordMatches) { + boolean match = false; + if (firstUnknownWordMatches) { + cityResult.firstUnknownWordMatches = false; // don't count same name twice + } else if (cityResult.firstUnknownWordMatches) { firstUnknownWordMatches = true; + match = true; } if (cityResult.otherWordsMatch != null) { - match = match || leftUnknownSearchWords.removeAll(cityResult.otherWordsMatch); + Iterator iterator = cityResult.otherWordsMatch.iterator(); + while (iterator.hasNext()) { + String n = iterator.next(); + boolean wasPresent = leftUnknownSearchWords.remove(n); + if (!wasPresent) { + iterator.remove(); // don't count same name twice + } else { + match = true; + } + } } + // include parent search result even if it is empty if (match) { newParentSearchResult = cityResult; } diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java index 028b3706bb..c72dd84079 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchResult.java @@ -48,18 +48,27 @@ public class SearchResult { private static final double MAX_TYPE_WEIGHT = 10; // maximum corresponds to the top entry - // this method returns: - // [1, 4] - if there is no parent search result - // [0, 1[ - if there is parent search result public double getUnknownPhraseMatchWeight() { + // if result is a complete match in the search we prioritize it highers + return getSumPhraseMatchWeight() / Math.pow(MAX_TYPE_WEIGHT, getDepth() - 1); + } + + public double getSumPhraseMatchWeight() { // if result is a complete match in the search we prioritize it highers double res = ObjectType.getTypeWeight(objectType); if (parentSearchResult != null) { - res = (res + parentSearchResult.getUnknownPhraseMatchWeight() / MAX_TYPE_WEIGHT) / MAX_TYPE_WEIGHT; + res = res + parentSearchResult.getSumPhraseMatchWeight() / MAX_TYPE_WEIGHT; } return res; } + public int getDepth() { + if (parentSearchResult != null) { + return 1 + parentSearchResult.getDepth(); + } + return 1; + } + public int getFoundWordCount() { int inc = 0; if (firstUnknownWordMatches) { diff --git a/OsmAnd-java/src/test/resources/search/100_bridge_street.json b/OsmAnd-java/src/test/resources/search/100_bridge_street.json index c100429032..034e6969d2 100644 --- a/OsmAnd-java/src/test/resources/search/100_bridge_street.json +++ b/OsmAnd-java/src/test/resources/search/100_bridge_street.json @@ -23,9 +23,9 @@ ], [ "100.0, [[1, PARTIAL_LOCATION, 1.000, 5591.91 km]]", - "100, Bridge Street, Westbrook [[4, HOUSE, 0.430, 11.29 km]]", - "Bridge Street, Westbrook [[3, STREET, 3.000, 11.35 km]]", + "100, Bridge Street, Westbrook [[4, HOUSE, 0.043, 11.29 km]]", "100, Bridge Street, Yarmouth [[3, HOUSE, 0.430, 23.69 km]]", + "Bridge Street, Westbrook [[3, STREET, 0.310, 11.35 km]]", "Bridge Street, Frenchtown [[2, STREET, 3.000, 11.35 km]]", "Bridge Street, Yarmouth [[2, STREET, 3.000, 23.44 km]]", "Bridge Street, Cornish [[2, STREET, 3.000, 27.39 km]]", diff --git a/OsmAnd-java/src/test/resources/search/carrer_de_vic.json b/OsmAnd-java/src/test/resources/search/carrer_de_vic.json index 4f89d6d72e..18f908690a 100644 --- a/OsmAnd-java/src/test/resources/search/carrer_de_vic.json +++ b/OsmAnd-java/src/test/resources/search/carrer_de_vic.json @@ -11,37 +11,36 @@ }, "phrase": "carrer de Vic, Sant Bartomeu del grau", "results": [ - "Carrer de Sant Bartomeu del Grau, Vic [[7, STREET, 3.000, 61.63 km]]", - "Carrer de Vic, Sant Bartomeu del Grau [[7, STREET, 3.000, 64.33 km]]" + "Carrer de Vic, Sant Bartomeu del Grau [[7, STREET, 0.310, 64.33 km]]", + "Carrer de Sant Bartomeu del Grau, Vic [[7, STREET, 0.310, 61.63 km]]" ], "extra-results": [ - "carrer Ponent, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.29 km]]", - "Carrer Pla de l'Oratori, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.38 km]]", - "carrer de Dalt, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.44 km]]", - "Carrer de la Migjorn, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.78 km]]", - "Carrer de la Tramuntana, Sant Bartomeu del Grau [[6, STREET, 3.000, 64.83 km]]", - "Carrer de la Codina (Xalet Mas Reig), Sant Bartomeu del Grau [[6, STREET, 3.000, 64.85 km]]", - "Carrer de Sant Bartomeu, Sant Cugat del Vallès [[5, STREET, 3.000, 11.20 km]]", - "Carrer Tres Creus, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.34 km]]", - "Carrer del Mig, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.43 km]]", - "carrer Vell, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.47 km]]", - "Carrer Nou, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.54 km]]", - "Carrer Llevant, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.76 km]]", - "Carrer del Garbí, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.79 km]]", - "Carrer del Gregal, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.80 km]]", - "Carrer del Xaloc, Sant Bartomeu del Grau [[5, STREET, 3.000, 64.90 km]]", - "Túnel de la Fontfreda (Pere-riera), Sant Bartomeu del Grau [[5, STREET, 3.000, 56.61 km]]", - "Eix Transversal C-25 Viaducte de Pere-riera, Sant Bartomeu del Grau [[5, STREET, 3.000, 57.32 km]]", - "Camí de Ca la Burra, Sant Bartomeu del Grau [[5, STREET, 3.000, 57.58 km]]", + "carrer Ponent, Sant Bartomeu del Grau [[6, STREET, 0.310, 64.29 km]]", + "Carrer Pla de l'Oratori, Sant Bartomeu del Grau [[6, STREET, 0.310, 64.38 km]]", + "carrer de Dalt, Sant Bartomeu del Grau [[6, STREET, 0.310, 64.44 km]]", + "Carrer de la Migjorn, Sant Bartomeu del Grau [[6, STREET, 0.310, 64.78 km]]", + "Carrer de la Tramuntana, Sant Bartomeu del Grau [[6, STREET, 0.310, 64.83 km]]", + "Carrer de la Codina (Xalet Mas Reig), Sant Bartomeu del Grau [[6, STREET, 0.310, 64.85 km]]", "Carretera de Sant Bartomeu del Grau, Muntanyola [[5, STREET, 3.000, 61.03 km]]", "Carretera de Sant Bartomeu del Grau, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.00 km]]", - "Camí de Sant Genís, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.08 km]]", - "Camí de Rogers, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.60 km]]", - "Carretera de Sant Bartomeu, Sant Bartomeu del Grau [[5, STREET, 3.000, 63.68 km]]", "Carretera de Sant Bartomeu del Grau, Xalet Mas Reig [[5, STREET, 3.000, 64.71 km]]", - "Camí de St. Bartomeu al Sorreig (Xalet Mas Reig), Sant Bartomeu del Grau [[5, STREET, 3.000, 65.11 km]]", + "Carrer de Sant Bartomeu, Sant Cugat del Vallès [[5, STREET, 0.310, 11.20 km]]", + "Carrer Tres Creus, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.34 km]]", + "Carrer del Mig, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.43 km]]", + "carrer Vell, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.47 km]]", + "Carrer Nou, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.54 km]]", + "Carrer Llevant, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.76 km]]", + "Carrer del Garbí, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.79 km]]", + "Carrer del Gregal, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.80 km]]", + "Carrer del Xaloc, Sant Bartomeu del Grau [[5, STREET, 0.310, 64.90 km]]", + "Túnel de la Fontfreda (Pere-riera), Sant Bartomeu del Grau [[5, STREET, 0.310, 56.61 km]]", + "Eix Transversal C-25 Viaducte de Pere-riera, Sant Bartomeu del Grau [[5, STREET, 0.310, 57.32 km]]", + "Camí de Ca la Burra, Sant Bartomeu del Grau [[5, STREET, 0.310, 57.58 km]]", + "Camí de Sant Genís, Sant Bartomeu del Grau [[5, STREET, 0.310, 63.08 km]]", + "Camí de Rogers, Sant Bartomeu del Grau [[5, STREET, 0.310, 63.60 km]]", + "Carretera de Sant Bartomeu, Sant Bartomeu del Grau [[5, STREET, 0.310, 63.68 km]]", + "Camí de St. Bartomeu al Sorreig (Xalet Mas Reig), Sant Bartomeu del Grau [[5, STREET, 0.310, 65.11 km]]", "Carrer de Sant Bartomeu, Martorell [[4, STREET, 3.000, 6.20 km]]", - "Carrer Bartomeu Garcia i Subirà, Sant Boi de Llobregat [[4, STREET, 3.000, 11.59 km]]", "Carrer de Sant Bartomeu de la Quadra (les Corts), Barcelona [[4, STREET, 3.000, 12.07 km]]", "Carrer de Sant Bartomeu (el Raval), Barcelona [[4, STREET, 3.000, 17.67 km]]", "Carrer de Sant Bartomeu (Sant Antoni de Llefià), Badalona [[4, STREET, 3.000, 20.95 km]]", @@ -64,102 +63,16 @@ "Carrer de Sant Bartomeu, Lloret de Mar [[4, STREET, 3.000, 79.60 km]]", "Carrer de Sant Bartomeu, Coll de Nargó [[4, STREET, 3.000, 99.35 km]]", "Carrer de Sant Bartomeu, Camallera [[4, STREET, 3.000, 113.48 km]]", - "Carretera de Sant Bartomeu, l'Ametlla del Vallès [[4, STREET, 3.000, 37.92 km]]", - "Camí d'Alboquers (Pere-riera), Sant Bartomeu del Grau [[4, STREET, 3.000, 58.08 km]]", - "Eix Transversal, Sant Bartomeu del Grau [[4, STREET, 3.000, 59.04 km]]", - "GR 3, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.08 km]]", - "Passeig del Grau, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.28 km]]", - "Plaça del Doctor Griera, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.36 km]]", - "Carretera del Cementiri, Sant Bartomeu del Grau [[4, STREET, 3.000, 64.42 km]]", - "Carrer de Sant Bartomeu [[4, POI, 2.000, 37.02 km]]", "Sant Bartomeu del Grau [[4, POI, 2.000, 64.32 km]]", "Sant Bartomeu del Grau [[4, POI, 2.000, 64.60 km]]", - "Carrer de Bartomeu Raurell, Gelida [[3, STREET, 3.000, 8.66 km]]", - "Carrer de Bartomeu Bermejo, Esplugues de Llobregat [[3, STREET, 3.000, 11.06 km]]", - "Carrer de Joan Bartomeu, Sabadell [[3, STREET, 3.000, 16.39 km]]", - "Carrer de Bartomeu Amat, Terrassa [[3, STREET, 3.000, 16.73 km]]", - "carrer del Doctor Robert (Bufalà), Badalona [[3, STREET, 3.000, 23.37 km]]", - "Carrer del Doctor Bartomeu Robert, Mollet del Vallès [[3, STREET, 3.000, 24.65 km]]", - "Carrer de Bartomeu Soler, Palau-solità i Plegamans [[3, STREET, 3.000, 25.99 km]]", - "G-06 Sant Bartomeu - Can Planes - Les escletxes, Molins de Rei [[3, STREET, 3.000, 5.65 km]]", - "Carrer Bartomeu, Montornès del Vallès [[3, STREET, 3.000, 28.26 km]]", - "Carrer de Bartomeu Rosselló Porcel, Lliçà de Vall [[3, STREET, 3.000, 28.86 km]]", - "Carrer sant Bartomeu, Òdena [[3, STREET, 3.000, 32.48 km]]", - "Carrer de Bartomeu Serret i Argemi, Granollers [[3, STREET, 3.000, 32.87 km]]", - "Costa de Sant Bartomeu de la Quadra (les Corts), Barcelona [[3, STREET, 3.000, 12.11 km]]", - "carrer del Doctor Bartomeu, Santa Susanna [[3, STREET, 3.000, 65.87 km]]", - "Carrer Sant Bartomeu, Casserres [[3, STREET, 3.000, 66.42 km]]", - "Avinguda de Bartomeu, Cerdanyola del Vallès [[3, STREET, 3.000, 13.29 km]]", - "Carrer Sant Bartomeu, Torelló [[3, STREET, 3.000, 73.57 km]]", - "Carrer Sant Bartomeu, Blanes [[3, STREET, 3.000, 73.61 km]]", - "Carrer Sant Bartomeu, Ripoll [[3, STREET, 3.000, 88.15 km]]", - "Camí de Vilassar de Dalt a Sant Bartomeu, Òrrius [[3, STREET, 3.000, 34.23 km]]", - "Camí de Mas Bartomeu, la Bisbal del Penedès [[3, STREET, 3.000, 39.50 km]]", - "Camí del Coll d'Arca a Mas Bartomeu, Masies de Sansuies [[3, STREET, 3.000, 41.52 km]]", - "Plaça de Sant Bartomeu, Alió [[3, STREET, 3.000, 57.01 km]]", - "Carretera de Sant Bartomeu, Gurb [[3, STREET, 3.000, 61.97 km]]", - "Camí de Sant Julià Sassorba a Sant Bartomeu, Gurb [[3, STREET, 3.000, 62.60 km]]", - "BV-4601 - Carretera de Sant Bartomeu, Gurb [[3, STREET, 3.000, 63.02 km]]", - "Camí d'Olost a la Carretera de Sant Bartomeu, Olost [[3, STREET, 3.000, 63.55 km]]", - "Camí d'Olost a la carretera de Sant Bartomeu, Olost [[3, STREET, 3.000, 67.15 km]]", - "Camí ramader de Sant Bartomeu, Sant Boi de Lluçanès [[3, STREET, 3.000, 68.86 km]]", - "Avinguda de Sant Bartomeu, Solsona [[3, STREET, 3.000, 73.65 km]]", - "Camí de Sant Bartomeu, l'Esquirol [[3, STREET, 3.000, 74.00 km]]", - "Camí de Sant Bartomeu (la Valldan), Berga [[3, STREET, 3.000, 75.54 km]]", - "Camí de Sant Bartomeu, el Tossal [[3, STREET, 3.000, 87.03 km]]", - "Camí de Sant Bartomeu (el Tossal), Ponts [[3, STREET, 3.000, 87.04 km]]", - "Baixada de Sant Bartomeu, Bellmunt d'Urgell [[3, STREET, 3.000, 92.97 km]]", - "Camí de Sant Bartomeu de Matamala, Porqueres [[3, STREET, 3.000, 100.30 km]]", - "Camí de Sant Bartomeu, Fontcoberta [[3, STREET, 3.000, 105.05 km]]", - "Riera de Sant Bartomeu [[3, POI, 2.000, 4.30 km]]", - "Riera de Sant Bartomeu [[3, POI, 2.000, 4.85 km]]", - "Sant Bartomeu de la Quadra [[3, POI, 2.000, 5.92 km]]", - "Sant Bartomeu de la Quadra [[3, POI, 2.000, 5.94 km]]", - "Sant Bartomeu de la Quadra [[3, POI, 2.000, 6.11 km]]", - "Sant Bartomeu de la Quadra [[3, POI, 2.000, 6.11 km]]", - "Parròquia de Sant Bartomeu [[3, POI, 2.000, 15.86 km]]", - "Parròquia de Sant Bartomeu [[3, POI, 2.000, 16.56 km]]", - "Torrent de Sant Bartomeu [[3, POI, 2.000, 34.74 km]]", - "Font de Sant Bartomeu [[3, POI, 2.000, 34.77 km]]", - "Torrent de Sant Bartomeu [[3, POI, 2.000, 34.78 km]]", - "Coll de Sant Bartomeu [[3, POI, 2.000, 34.97 km]]", - "Sant Bartomeu de Cabanyes [[3, POI, 2.000, 34.97 km]]", - "Sant Bartomeu de Navarcles [[3, POI, 2.000, 37.15 km]]", - "Ermita de Sant Bartomeu [[3, POI, 2.000, 37.55 km]]", - "Plana del Mas de Bartomeu [[3, POI, 2.000, 40.31 km]]", - "Esglèsia de Sant Bartomeu [[3, POI, 2.000, 44.70 km]]", - "Esgèsia de Sant Bartomeu [[3, POI, 2.000, 47.71 km]]", - "Sant Bartomeu de Carbasí [[3, POI, 2.000, 49.20 km]]", - "Plaça de Sant Bartomeu [[3, POI, 2.000, 56.99 km]]", - "riera de Sant Bartomeu [[3, POI, 2.000, 59.66 km]]", - "Sant Bartomeu de la Vall de Vilaramó [[3, POI, 2.000, 60.00 km]]", - "St. Bartomeu del Grau / Gurb [[3, POI, 2.000, 61.41 km]]", - "St. Bartomeu del Grau / Gurb [[3, POI, 2.000, 61.74 km]]", - "Carretera de Sant Bartomeu [[3, POI, 2.000, 62.08 km]]", - "Carretera de Sant Bartomeu [[3, POI, 2.000, 62.89 km]]", - "Bac de Sant Bartomeu [[3, POI, 2.000, 73.44 km]]", - "Serrat de Sant Bartomeu [[3, POI, 2.000, 74.98 km]]", - "Capella de Sant Bartomeu [[3, POI, 2.000, 83.35 km]]", - "Collada de Sant Bartomeu [[3, POI, 2.000, 83.91 km]]", - "Baga de Sant Bartomeu [[3, POI, 2.000, 84.00 km]]", - "Riera de Sant Bartomeu [[3, POI, 2.000, 84.24 km]]", - "Sant Bartomeu de Covildases [[3, POI, 2.000, 84.43 km]]", - "Sant Bartomeu de Llaés [[3, POI, 2.000, 84.58 km]]", - "Església de Sant Bartomeu [[3, POI, 2.000, 93.91 km]]", - "Barranc de Sant Bartomeu [[3, POI, 2.000, 95.89 km]]", - "Esglesia de Sant Bartomeu [[3, POI, 2.000, 108.27 km]]", - "Sant Bartomeu del Portell [[3, POI, 2.000, 108.34 km]]", - "Sant Bartomeu de Favà [[3, POI, 2.000, 111.19 km]]", - "Sant Bartomeu de Malgrat [[3, POI, 2.000, 111.67 km]]", - "Baixada de Sant Bartomeu [[3, POI, 2.000, 112.07 km]]", - "Església de Sant Bartomeu [[3, POI, 2.000, 113.41 km]]", - "Sant Bartomeu de Pincaró [[3, POI, 2.000, 117.14 km]]", - "Tossal de Sant Bartomeu [[3, POI, 2.000, 121.97 km]]", - "Roc de Sant Bartomeu [[3, POI, 2.000, 124.93 km]]", - "Serra de Sant Bartomeu [[3, POI, 2.000, 127.07 km]]", - "Sant Bartomeu de Burg [[3, POI, 2.000, 133.20 km]]", - "Ermita de Sant Bartomeu [[3, POI, 2.000, 139.23 km]]", - "Sant Bartomeu de la Quadra, l'Hospitalet de Llobregat [[3, VILLAGE, 1.000, 5.94 km]]" + "Carrer Bartomeu Garcia i Subirà, Sant Boi de Llobregat [[4, STREET, 0.310, 11.59 km]]", + "Carretera de Sant Bartomeu, l'Ametlla del Vallès [[4, STREET, 0.310, 37.92 km]]", + "Camí d'Alboquers (Pere-riera), Sant Bartomeu del Grau [[4, STREET, 0.310, 58.08 km]]", + "Eix Transversal, Sant Bartomeu del Grau [[4, STREET, 0.310, 59.04 km]]", + "GR 3, Sant Bartomeu del Grau [[4, STREET, 0.310, 64.08 km]]", + "Passeig del Grau, Sant Bartomeu del Grau [[4, STREET, 0.310, 64.28 km]]", + "Plaça del Doctor Griera, Sant Bartomeu del Grau [[4, STREET, 0.310, 64.36 km]]", + "Carretera del Cementiri, Sant Bartomeu del Grau [[4, STREET, 0.310, 64.42 km]]" ], "amenities": [ diff --git a/OsmAnd-java/src/test/resources/search/free_street_portland.json b/OsmAnd-java/src/test/resources/search/free_street_portland.json index b809d1f6ab..92351f530c 100644 --- a/OsmAnd-java/src/test/resources/search/free_street_portland.json +++ b/OsmAnd-java/src/test/resources/search/free_street_portland.json @@ -11,537 +11,18 @@ }, "phrase": "48 Free Street Portland", "results": [ - "48.0, [[1, PARTIAL_LOCATION, 1.000, 5274.99 km]]", - "48, Free Street (Downtown), Portland [[4, HOUSE, 0.430, 0.09 km]]", - "Free Street (Downtown), Portland [[3, STREET, 3.000, 0.03 km]]", - "Free Street (Ferry Village), South Portland [[3, STREET, 3.000, 1.69 km]]", - "48, Portland Street, North Berwick [[3, HOUSE, 0.430, 54.48 km]]" + "48.0, [[0, PARTIAL_LOCATION, 1.000, 5274.99 km]]", + "48, Free Street (Downtown), Portland [[4, HOUSE, 0.043, 0.09 km]]", + "48, Portland Street, North Berwick [[3, HOUSE, 0.430, 54.48 km]]", + "Free Street (Downtown), Portland [[3, STREET, 0.310, 0.03 km]]", + "Free Street (Ferry Village), South Portland [[3, STREET, 0.310, 1.69 km]]", ], "extra-results": [ - "Cross North Street, Portland [[2, STREET, 3.000, 0.06 km]]", - "Cross Street Stairs, Portland [[2, STREET, 3.000, 0.07 km]]", - "Cotton Street, Portland [[2, STREET, 3.000, 0.14 km]]", - "Center Street (Old Port), Portland [[2, STREET, 3.000, 0.17 km]]", - "Temple Street (Downtown), Portland [[2, STREET, 3.000, 0.18 km]]", - "Brown Street (Downtown), Portland [[2, STREET, 3.000, 0.20 km]]", - "South Street (Old Port), Portland [[2, STREET, 3.000, 0.21 km]]", - "Cross Street (Old Port), Portland [[2, STREET, 3.000, 0.24 km]]", - "Exchange Street (Downtown), Portland [[2, STREET, 3.000, 0.25 km]]", - "Union Street (Old Port), Portland [[2, STREET, 3.000, 0.28 km]]", - "Wharf Street (Old Port), Portland [[2, STREET, 3.000, 0.29 km]]", - "Market Street (Old Port), Portland [[2, STREET, 3.000, 0.33 km]]", - "Chestnut Street (Downtown), Portland [[2, STREET, 3.000, 0.35 km]]", - "Casco Street (Downtown), Portland [[2, STREET, 3.000, 0.36 km]]", - "Dana Street (Old Port), Portland [[2, STREET, 3.000, 0.36 km]]", - "Federal West Street, Portland [[2, STREET, 3.000, 0.36 km]]", - "Maple Street (Old Port), Portland [[2, STREET, 3.000, 0.38 km]]", - "Oak Street (Downtown), Portland [[2, STREET, 3.000, 0.38 km]]", - "Shepley Street (Downtown), Portland [[2, STREET, 3.000, 0.38 km]]", - "York Street (Old Port), Portland [[2, STREET, 3.000, 0.38 km]]", - "Cedar Street (Downtown), Portland [[2, STREET, 3.000, 0.39 km]]", - "Moulton Street (Old Port), Portland [[2, STREET, 3.000, 0.41 km]]", - "Silver Street (Old Port), Portland [[2, STREET, 3.000, 0.41 km]]", - "Church Street, Portland [[2, STREET, 3.000, 0.42 km]]", - "Pleasant Street (Downtown), Portland [[2, STREET, 3.000, 0.42 km]]", - "Stone Street (Downtown), Portland [[2, STREET, 3.000, 0.42 km]]", - "Milk Street (Old Port), Portland [[2, STREET, 3.000, 0.42 km]]", - "Central Wharf Street, Portland [[2, STREET, 3.000, 0.46 km]]", - "Chapel Street, Portland [[2, STREET, 3.000, 0.47 km]]", - "Elm Street (Downtown), Portland [[2, STREET, 3.000, 0.47 km]]", - "Parris Street, Portland [[2, STREET, 3.000, 0.49 km]]", - "High Street Court, Portland [[2, STREET, 3.000, 0.49 km]]", - "Gold Street (Old Port), Portland [[2, STREET, 3.000, 0.50 km]]", - "Alder Street (Downtown), Portland [[2, STREET, 3.000, 0.50 km]]", - "Federal Street, Portland [[2, STREET, 3.000, 0.50 km]]", - "Newbury West Street, Portland [[2, STREET, 3.000, 0.50 km]]", - "Myrtle Street (Downtown), Portland [[2, STREET, 3.000, 0.51 km]]", - "High Street (Downtown), Portland [[2, STREET, 3.000, 0.52 km]]", - "Custom House Street, Portland [[2, STREET, 3.000, 0.56 km]]", - "Spring Street Place (Downtown), Portland [[2, STREET, 3.000, 0.58 km]]", - "Wilmot Street, Portland [[2, STREET, 3.000, 0.58 km]]", - "Oxford Street, Portland [[2, STREET, 3.000, 0.59 km]]", - "Franklin Street, Portland [[2, STREET, 3.000, 0.59 km]]", - "Mechanic Street (Downtown), Portland [[2, STREET, 3.000, 0.59 km]]", - "Nye Street (Downtown), Portland [[2, STREET, 3.000, 0.60 km]]", - "Hampshire Street, Portland [[2, STREET, 3.000, 0.61 km]]", - "Middle Street, Portland [[2, STREET, 3.000, 0.61 km]]", - "Portland Street (Downtown), Portland [[2, STREET, 3.000, 0.62 km]]", - "Preble Street (Downtown), Portland [[2, STREET, 3.000, 0.62 km]]", - "Park Street (Downtown), Portland [[2, STREET, 3.000, 0.64 km]]", - "Fore Street, Portland [[2, STREET, 3.000, 0.66 km]]", - "Spring Street (Downtown), Portland [[2, STREET, 3.000, 0.68 km]]", - "Henry Street (Downtown), Portland [[2, STREET, 3.000, 0.69 km]]", - "Lancaster Street, Portland [[2, STREET, 3.000, 0.72 km]]", - "Locust Street, Portland [[2, STREET, 3.000, 0.72 km]]", - "Kennebec Street (Downtown), Portland [[2, STREET, 3.000, 0.72 km]]", - "Commercial Street, Portland [[2, STREET, 3.000, 0.73 km]]", - "Deering Street (Downtown), Portland [[2, STREET, 3.000, 0.73 km]]", - "Newbury Street, Portland [[2, STREET, 3.000, 0.73 km]]", - "Pearl Street, Portland [[2, STREET, 3.000, 0.73 km]]", - "Stetson Street (Downtown), Portland [[2, STREET, 3.000, 0.73 km]]", - "Hanover Street (Downtown), Portland [[2, STREET, 3.000, 0.74 km]]", - "Brattle Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", - "Avon Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", - "Grant Street (Downtown), Portland [[2, STREET, 3.000, 0.76 km]]", - "India Street, Portland [[2, STREET, 3.000, 0.76 km]]", - "Sherman Street (Downtown), Portland [[2, STREET, 3.000, 0.77 km]]", - "Congress Street, Portland [[2, STREET, 3.000, 0.77 km]]", - "Somerset Street, Portland [[2, STREET, 3.000, 0.79 km]]", - "Boyd Street, Portland [[2, STREET, 3.000, 0.80 km]]", - "Federal East Street, Portland [[2, STREET, 3.000, 0.82 km]]", - "Smith Street, Portland [[2, STREET, 3.000, 0.82 km]]", - "East Oxford Street, Portland [[2, STREET, 3.000, 0.82 km]]", - "Fox Street, Portland [[2, STREET, 3.000, 0.83 km]]", - "Mayo Street, Portland [[2, STREET, 3.000, 0.84 km]]", - "State Street (West End), Portland [[2, STREET, 3.000, 0.86 km]]", - "North Boyd Street Trail, Portland [[2, STREET, 3.000, 0.87 km]]", - "Hancock Street, Portland [[2, STREET, 3.000, 0.87 km]]", - "Montgomery Street (East End), Portland [[2, STREET, 3.000, 0.88 km]]", - "Tyng Street (Downtown), Portland [[2, STREET, 3.000, 0.89 km]]", - "Tate Street, Portland [[2, STREET, 3.000, 0.92 km]]", - "Thames Street, Portland [[2, STREET, 3.000, 0.92 km]]", - "Gray Street (West End), Portland [[2, STREET, 3.000, 0.93 km]]", - "Winter Street (West End), Portland [[2, STREET, 3.000, 0.94 km]]", - "Cleeves Street, Portland [[2, STREET, 3.000, 0.94 km]]", - "Cleeve Street (East End), Portland [[2, STREET, 3.000, 0.96 km]]", - "North Boyd Street, Portland [[2, STREET, 3.000, 0.97 km]]", - "East Lancaster Street, Portland [[2, STREET, 3.000, 0.98 km]]", - "Dow Street (West End), Portland [[2, STREET, 3.000, 0.98 km]]", - "Mountfort Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.00 km]]", - "Ponce Street, Portland [[2, STREET, 3.000, 1.02 km]]", - "Brackett Street (West End), Portland [[2, STREET, 3.000, 1.02 km]]", - "Mellen Street, Portland [[2, STREET, 3.000, 1.05 km]]", - "Summer Street (West End), Portland [[2, STREET, 3.000, 1.05 km]]", - "Pine Street (West End), Portland [[2, STREET, 3.000, 1.05 km]]", - "Diamond Street (East End), Portland [[2, STREET, 3.000, 1.06 km]]", - "Walker Street (West End), Portland [[2, STREET, 3.000, 1.07 km]]", - "Greenleaf Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", - "Everett Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", - "Monroe Street (East End), Portland [[2, STREET, 3.000, 1.08 km]]", - "Clark Street (West End), Portland [[2, STREET, 3.000, 1.10 km]]", - "Briggs Street (West End), Portland [[2, STREET, 3.000, 1.12 km]]", - "North Greenleaf Street, Portland [[2, STREET, 3.000, 1.13 km]]", - "Houlton Street (West End), Portland [[2, STREET, 3.000, 1.13 km]]", - "Madison Street (East End), Portland [[2, STREET, 3.000, 1.14 km]]", - "Beach Street (West End), Portland [[2, STREET, 3.000, 1.15 km]]", - "Lewis Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", - "Cushman Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", - "May Street (West End), Portland [[2, STREET, 3.000, 1.16 km]]", - "Anderson Street (East End), Portland [[2, STREET, 3.000, 1.17 km]]", - "Sheridan Street (East End), Portland [[2, STREET, 3.000, 1.19 km]]", - "Winthrop Street (East End), Portland [[2, STREET, 3.000, 1.20 km]]", - "Danforth Street (West End), Portland [[2, STREET, 3.000, 1.21 km]]", - "Salem Street (West End), Portland [[2, STREET, 3.000, 1.21 km]]", - "Kellogg Street, Portland [[2, STREET, 3.000, 1.22 km]]", - "Carleton Street (West End), Portland [[2, STREET, 3.000, 1.23 km]]", - "Hammond Street (East End), Portland [[2, STREET, 3.000, 1.24 km]]", - "School Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", - "Marion Street (East End), Portland [[2, STREET, 3.000, 1.25 km]]", - "Bond Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", - "Preble Street Extension, Portland [[2, STREET, 3.000, 1.25 km]]", - "Taylor Street (West End), Portland [[2, STREET, 3.000, 1.25 km]]", - "Adams Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.27 km]]", - "Orange Street (West End), Portland [[2, STREET, 3.000, 1.28 km]]", - "Sherbrooke Street, Portland [[2, STREET, 3.000, 1.29 km]]", - "Neal Street (West End), Portland [[2, STREET, 3.000, 1.29 km]]", - "Emery Street (West End), Portland [[2, STREET, 3.000, 1.29 km]]", - "Monument Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.30 km]]", - "Marshall Street (West End), Portland [[2, STREET, 3.000, 1.30 km]]", - "Waterville Street, Portland [[2, STREET, 3.000, 1.32 km]]", - "Hill Street (West End), Portland [[2, STREET, 3.000, 1.34 km]]", - "Ellsworth Street (West End), Portland [[2, STREET, 3.000, 1.34 km]]", - "St Lawrence Street, Portland [[2, STREET, 3.000, 1.35 km]]", - "Cove Street (East End), Portland [[2, STREET, 3.000, 1.36 km]]", - "Spruce Street (West End), Portland [[2, STREET, 3.000, 1.36 km]]", - "West Commercial Street, Portland [[2, STREET, 3.000, 1.37 km]]", - "West Street (West End), Portland [[2, STREET, 3.000, 1.38 km]]", - "Carroll Street (West End), Portland [[2, STREET, 3.000, 1.40 km]]", - "Atlantic Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.41 km]]", - "Russell Street (West End), Portland [[2, STREET, 3.000, 1.42 km]]", - "Wescott Street (West End), Portland [[2, STREET, 3.000, 1.42 km]]", - "Lafayette Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.43 km]]", - "Wilson Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.43 km]]", - "Cove Street stairs, Portland [[2, STREET, 3.000, 1.43 km]]", - "East Cove Street, Portland [[2, STREET, 3.000, 1.43 km]]", + "Portland Street (Downtown), Portland [[2, STREET, 3.000, 0.62 km]]", "Portland Street Pier, South Portland [[2, STREET, 3.000, 1.43 km]]", - "Charles Street (West End), Portland [[2, STREET, 3.000, 1.44 km]]", - "Sheridan Street Woonerf, Portland [[2, STREET, 3.000, 1.44 km]]", - "Merrill Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.45 km]]", - "Gould Street (East End), Portland [[2, STREET, 3.000, 1.45 km]]", - "Thomas Street (West End), Portland [[2, STREET, 3.000, 1.46 km]]", - "Storer Street (West End), Portland [[2, STREET, 3.000, 1.46 km]]", - "Crescent Street (West End), Portland [[2, STREET, 3.000, 1.47 km]]", - "Bank Street (Bayside), Portland [[2, STREET, 3.000, 1.47 km]]", - "Durham Street (Oakdale), Portland [[2, STREET, 3.000, 1.47 km]]", - "Bedford Street (Oakdale), Portland [[2, STREET, 3.000, 1.49 km]]", - "Moody Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.49 km]]", - "Weymouth Street (West End), Portland [[2, STREET, 3.000, 1.50 km]]", - "Munjoy Street, Portland [[2, STREET, 3.000, 1.50 km]]", - "North Street (East End), Portland [[2, STREET, 3.000, 1.50 km]]", - "Vaughan Street (West End), Portland [[2, STREET, 3.000, 1.51 km]]", - "Beckett Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.52 km]]", - "Boynton Street (West End), Portland [[2, STREET, 3.000, 1.52 km]]", - "Obrion Street, Portland [[2, STREET, 3.000, 1.52 km]]", - "Front Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.52 km]]", - "Howard Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.52 km]]", - "Fenwick Street, Portland [[2, STREET, 3.000, 1.53 km]]", - "O'Brion Street, Portland [[2, STREET, 3.000, 1.54 km]]", - "Surrenden Street, Portland [[2, STREET, 3.000, 1.54 km]]", - "High Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.54 km]]", - "Clifford Street (West End), Portland [[2, STREET, 3.000, 1.55 km]]", - "Turner Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.56 km]]", - "Willis Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.56 km]]", - "Dyer Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.58 km]]", - "Bramhall Street, Portland [[2, STREET, 3.000, 1.58 km]]", - "Chadwick Street (West End), Portland [[2, STREET, 3.000, 1.58 km]]", - "Vesper Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.59 km]]", - "Fletcher Street (West End), Portland [[2, STREET, 3.000, 1.59 km]]", - "Monroe Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.59 km]]", - "Emerson Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.60 km]]", - "Montreal Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.60 km]]", - "Orchard Street (West End), Portland [[2, STREET, 3.000, 1.61 km]]", - "Forest Street (West End), Portland [[2, STREET, 3.000, 1.63 km]]", - "Paper Street, Portland [[2, STREET, 3.000, 1.63 km]]", - "Gilman Street (West End), Portland [[2, STREET, 3.000, 1.63 km]]", - "Plowman Street, Portland [[2, STREET, 3.000, 1.64 km]]", - "Randall Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.64 km]]", - "Walnut Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", - "Melbourne Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", - "Oak Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.65 km]]", - "Quebec Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.65 km]]", - "Ocean Street Spur, South Portland [[2, STREET, 3.000, 1.66 km]]", - "Morning Street (Munjoy Hill), Portland [[2, STREET, 3.000, 1.67 km]]", - "Tukey Street Connector, Portland [[2, STREET, 3.000, 1.68 km]]", - "Jefferson Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.69 km]]", - "A Street (West End), Portland [[2, STREET, 3.000, 1.69 km]]", - "Granite Street (Oakdale), Portland [[2, STREET, 3.000, 1.69 km]]", - "Falmouth Street (Oakdale), Portland [[2, STREET, 3.000, 1.70 km]]", - "North Marriner Street, South Portland [[2, STREET, 3.000, 1.71 km]]", - "Valley Street (West End), Portland [[2, STREET, 3.000, 1.72 km]]", - "A Street, South Portland [[2, STREET, 3.000, 1.73 km]]", - "Ocean Street, South Portland [[2, STREET, 3.000, 1.74 km]]", - "Mosher Street, South Portland [[2, STREET, 3.000, 1.75 km]]", - "Edmund S Muskie Street, South Portland [[2, STREET, 3.000, 1.76 km]]", - "Fessenden Street, Portland [[2, STREET, 3.000, 1.78 km]]", - "C Street (West End), Portland [[2, STREET, 3.000, 1.79 km]]", - "School Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.80 km]]", - "Stanford Street, South Portland [[2, STREET, 3.000, 1.80 km]]", - "Bowdoin Street (West End), Portland [[2, STREET, 3.000, 1.81 km]]", - "B Street (Knightville), South Portland [[2, STREET, 3.000, 1.82 km]]", - "Exeter Street, Portland [[2, STREET, 3.000, 1.83 km]]", - "Preble Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.83 km]]", - "St John Street (West End), Portland [[2, STREET, 3.000, 1.84 km]]", - "Saint John Street (Libbytown), Portland [[2, STREET, 3.000, 1.84 km]]", - "Pierce Street (Ferry Village), South Portland [[2, STREET, 3.000, 1.84 km]]", - "D Street (West End), Portland [[2, STREET, 3.000, 1.86 km]]", - "Deane Street (Oakdale), Portland [[2, STREET, 3.000, 1.86 km]]", - "Pitt Street (Oakdale), Portland [[2, STREET, 3.000, 1.86 km]]", - "2nd Street, South Portland [[2, STREET, 3.000, 1.87 km]]", - "Payson Street, Portland [[2, STREET, 3.000, 1.88 km]]", - "C Street (Knightville), South Portland [[2, STREET, 3.000, 1.92 km]]", - "Roberts Street (Oakdale), Portland [[2, STREET, 3.000, 1.93 km]]", - "Woodmont Street (Oakdale), Portland [[2, STREET, 3.000, 1.94 km]]", - "Hemlock Street (Libbytown), Portland [[2, STREET, 3.000, 1.95 km]]", - "Cutter Street, Portland [[2, STREET, 3.000, 1.95 km]]", - "Maple Street, South Portland [[2, STREET, 3.000, 1.97 km]]", - "D Street (Knightville), South Portland [[2, STREET, 3.000, 1.98 km]]", - "Kincaid Street, South Portland [[2, STREET, 3.000, 2.01 km]]", - "Madison Street (Ferry Village), South Portland [[2, STREET, 3.000, 2.02 km]]", - "Cherry Street (Libbytown), Portland [[2, STREET, 3.000, 2.02 km]]", - "3rd Street, South Portland [[2, STREET, 3.000, 2.02 km]]", - "Kenwood Street, Portland [[2, STREET, 3.000, 2.02 km]]", - "Henley Street, South Portland [[2, STREET, 3.000, 2.03 km]]", - "Pine Street, South Portland [[2, STREET, 3.000, 2.04 km]]", - "Westfield Street (Libbytown), Portland [[2, STREET, 3.000, 2.05 km]]", - "William Street (Oakdale), Portland [[2, STREET, 3.000, 2.05 km]]", - "Roosevelt Street, South Portland [[2, STREET, 3.000, 2.05 km]]", - "Burnham Street (Libbytown), Portland [[2, STREET, 3.000, 2.05 km]]", - "Marston Street (Libbytown), Portland [[2, STREET, 3.000, 2.06 km]]", - "E Street (Knightville), South Portland [[2, STREET, 3.000, 2.08 km]]", - "Dartmouth Street (Oakdale), Portland [[2, STREET, 3.000, 2.08 km]]", - "F Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.08 km]]", - "Q Street, South Portland [[2, STREET, 3.000, 2.10 km]]", - "Freeman Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.10 km]]", - "Lowell Street (Libbytown), Portland [[2, STREET, 3.000, 2.11 km]]", - "Oakdale Street (Oakdale), Portland [[2, STREET, 3.000, 2.12 km]]", - "Sheffield Street, Portland [[2, STREET, 3.000, 2.12 km]]", - "Harriet Street, South Portland [[2, STREET, 3.000, 2.16 km]]", - "Saint James Street (Oakdale), Portland [[2, STREET, 3.000, 2.17 km]]", - "St James Street (Libbytown), Portland [[2, STREET, 3.000, 2.18 km]]", - "Huntress Street, Portland [[2, STREET, 3.000, 2.18 km]]", - "Mussey Street, South Portland [[2, STREET, 3.000, 2.18 km]]", - "Longfellow East Street, Portland [[2, STREET, 3.000, 2.18 km]]", - "Catherine Street, Portland [[2, STREET, 3.000, 2.20 km]]", - "Noyes Street (Oakdale), Portland [[2, STREET, 3.000, 2.21 km]]", - "Marriner Street, South Portland [[2, STREET, 3.000, 2.22 km]]", - "Thomas Street (Knightville), South Portland [[2, STREET, 3.000, 2.23 km]]", - "Margaret Street, South Portland [[2, STREET, 3.000, 2.23 km]]", - "Longfellow Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.23 km]]", - "Belmont Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.23 km]]", - "Mechanic Street (Knightville), South Portland [[2, STREET, 3.000, 2.27 km]]", - "Grand Street, South Portland [[2, STREET, 3.000, 2.28 km]]", - "Frederic Street, Portland [[2, STREET, 3.000, 2.29 km]]", - "Ballard Street (Knightville), South Portland [[2, STREET, 3.000, 2.30 km]]", - "Holwell Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.30 km]]", - "Spring Street, South Portland [[2, STREET, 3.000, 2.30 km]]", - "Market Street (Knightville), South Portland [[2, STREET, 3.000, 2.31 km]]", - "Soule Street, South Portland [[2, STREET, 3.000, 2.31 km]]", - "St John Street (Oakdale), Portland [[2, STREET, 3.000, 2.32 km]]", - "Benjamin W Pickett Street, South Portland [[2, STREET, 3.000, 2.33 km]]", - "Linden Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.34 km]]", - "Palmer Street (Knightville), South Portland [[2, STREET, 3.000, 2.34 km]]", - "Castle Street, South Portland [[2, STREET, 3.000, 2.35 km]]", - "Cobb Street, South Portland [[2, STREET, 3.000, 2.36 km]]", - "Wadsworth Street (Oakdale), Portland [[2, STREET, 3.000, 2.36 km]]", - "Summit Street, South Portland [[2, STREET, 3.000, 2.37 km]]", - "Cottage Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.38 km]]", - "Adams Street (Ferry Village), South Portland [[2, STREET, 3.000, 2.38 km]]", - "Devonshire Street (Oakdale), Portland [[2, STREET, 3.000, 2.41 km]]", - "Douglass Street (Oakdale), Portland [[2, STREET, 3.000, 2.42 km]]", - "Melrose Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.42 km]]", - "Clemons Street, South Portland [[2, STREET, 3.000, 2.43 km]]", - "St George Street (Oakdale), Portland [[2, STREET, 3.000, 2.44 km]]", - "Barstow Street, South Portland [[2, STREET, 3.000, 2.44 km]]", - "Emery Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.46 km]]", - "Saint George Street (Oakdale), Portland [[2, STREET, 3.000, 2.46 km]]", - "North Richland Street, South Portland [[2, STREET, 3.000, 2.49 km]]", - "Broadway Street (Knightville), South Portland [[2, STREET, 3.000, 2.49 km]]", - "Ocean House Street, South Portland [[2, STREET, 3.000, 2.50 km]]", - "Arlington Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.50 km]]", - "Beverly Street, South Portland [[2, STREET, 3.000, 2.50 km]]", - "Sprauge Street, South Portland [[2, STREET, 3.000, 2.51 km]]", - "Hanson Street (Knightville), South Portland [[2, STREET, 3.000, 2.51 km]]", - "Woodfords Street, Portland [[2, STREET, 3.000, 2.53 km]]", - "Pickett Street, South Portland [[2, STREET, 3.000, 2.56 km]]", - "Armory Street (Knightville), South Portland [[2, STREET, 3.000, 2.56 km]]", - "Smith Street (Willard Square), South Portland [[2, STREET, 3.000, 2.58 km]]", - "Bolton Street (Rosemont), Portland [[2, STREET, 3.000, 2.58 km]]", - "Taylor Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.59 km]]", - "Thompson Street (Willard Square), South Portland [[2, STREET, 3.000, 2.60 km]]", - "Buttonwood Street, South Portland [[2, STREET, 3.000, 2.61 km]]", - "Lincoln Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.61 km]]", - "Grace Street Place (Woodfords Corner), Portland [[2, STREET, 3.000, 2.61 km]]", - "6th Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.62 km]]", - "Bates Street (East Deering), Portland [[2, STREET, 3.000, 2.63 km]]", - "Pearl Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.63 km]]", - "Bowers Street, South Portland [[2, STREET, 3.000, 2.64 km]]", - "Ashmont Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.65 km]]", - "Grace Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.66 km]]", - "Beach Street (Willard Square), South Portland [[2, STREET, 3.000, 2.66 km]]", - "Elm Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.66 km]]", - "Revere Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.66 km]]", - "Emmons Street, Portland [[2, STREET, 3.000, 2.66 km]]", - "Jordan Street (East Deering), Portland [[2, STREET, 3.000, 2.67 km]]", - "Coyle Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.68 km]]", - "Chestnut Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.68 km]]", - "Walnut Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.68 km]]", - "Orland Street, Portland [[2, STREET, 3.000, 2.69 km]]", - "O'Neil Street, South Portland [[2, STREET, 3.000, 2.69 km]]", - "Galvin Street, Portland [[2, STREET, 3.000, 2.69 km]]", - "Lowell Street (Willard Square), South Portland [[2, STREET, 3.000, 2.69 km]]", - "Chase Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.69 km]]", - "Sewall Street (Rosemont), Portland [[2, STREET, 3.000, 2.70 km]]", - "Vincent Street, South Portland [[2, STREET, 3.000, 2.70 km]]", - "Longfellow West Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.71 km]]", - "Randall Street (East Deering), Portland [[2, STREET, 3.000, 2.72 km]]", - "Codman Street, Portland [[2, STREET, 3.000, 2.73 km]]", - "Mildred Street, South Portland [[2, STREET, 3.000, 2.73 km]]", - "Cooper Street (Knightville), South Portland [[2, STREET, 3.000, 2.73 km]]", - "Alpine Street (Knightville), South Portland [[2, STREET, 3.000, 2.73 km]]", - "Alder Street (Willard Square), South Portland [[2, STREET, 3.000, 2.74 km]]", - "Davis Street (Rosemont), Portland [[2, STREET, 3.000, 2.74 km]]", - "Tanner Street, South Portland [[2, STREET, 3.000, 2.75 km]]", - "Berwick Street (East Deering), Portland [[2, STREET, 3.000, 2.75 km]]", - "Day Street (Willard Square), South Portland [[2, STREET, 3.000, 2.75 km]]", - "Frances Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.75 km]]", - "Hersey Street, Portland [[2, STREET, 3.000, 2.76 km]]", - "W Presumpscot Street W, Portland [[2, STREET, 3.000, 2.76 km]]", - "Chapel Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.76 km]]", - "Deblois Street, Portland [[2, STREET, 3.000, 2.76 km]]", - "Morse Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.76 km]]", - "Hooper Street (Libbytown), Portland [[2, STREET, 3.000, 2.77 km]]", - "Walker Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.77 km]]", - "Scott Street (Rosemont), Portland [[2, STREET, 3.000, 2.79 km]]", - "Illsley Street, Portland [[2, STREET, 3.000, 2.80 km]]", - "Edwards Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.80 km]]", - "Churchill Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", - "Clifton Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.81 km]]", - "Lennox Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", - "Front Street (East Deering), Portland [[2, STREET, 3.000, 2.81 km]]", - "Greeley Street (Rosemont), Portland [[2, STREET, 3.000, 2.82 km]]", - "Chenery Street, Portland [[2, STREET, 3.000, 2.82 km]]", - "Beacon Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.82 km]]", - "Kendall Street (East Deering), Portland [[2, STREET, 3.000, 2.83 km]]", - "Fairmount Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.83 km]]", - "West Presumpscot Street, Portland [[2, STREET, 3.000, 2.83 km]]", - "Scamman Street, South Portland [[2, STREET, 3.000, 2.84 km]]", - "Anthoine Street, South Portland [[2, STREET, 3.000, 2.84 km]]", - "Powsland Street (Rosemont), Portland [[2, STREET, 3.000, 2.85 km]]", - "Bennett Street (Knightville), South Portland [[2, STREET, 3.000, 2.86 km]]", - "George Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.88 km]]", - "Pembroke Street, Portland [[2, STREET, 3.000, 2.88 km]]", - "Mitton Street (Rosemont), Portland [[2, STREET, 3.000, 2.88 km]]", - "Brenton Street, South Portland [[2, STREET, 3.000, 2.88 km]]", - "Chester Street (East Deering), Portland [[2, STREET, 3.000, 2.89 km]]", - "South Richland Street, South Portland [[2, STREET, 3.000, 2.89 km]]", - "Craigie Street (Deering Highlands), Portland [[2, STREET, 3.000, 2.89 km]]", - "Saunders Street, Portland [[2, STREET, 3.000, 2.90 km]]", - "North Kelsey Street, South Portland [[2, STREET, 3.000, 2.91 km]]", - "Austin Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.91 km]]", - "Nevens Street, Portland [[2, STREET, 3.000, 2.91 km]]", - "Sherwood Street (East Deering), Portland [[2, STREET, 3.000, 2.91 km]]", - "Robinson Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.92 km]]", - "Pillsbury Street, South Portland [[2, STREET, 3.000, 2.92 km]]", - "Cedar Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.92 km]]", - "Willow Street (Willard Square), South Portland [[2, STREET, 3.000, 2.93 km]]", - "Carter Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.93 km]]", - "Kensington Street, Portland [[2, STREET, 3.000, 2.93 km]]", - "Cummings Street, Portland [[2, STREET, 3.000, 2.93 km]]", - "Mackworth Street, Portland [[2, STREET, 3.000, 2.94 km]]", - "Kelly Street (Knightville), South Portland [[2, STREET, 3.000, 2.95 km]]", - "Lahave Street, South Portland [[2, STREET, 3.000, 2.95 km]]", - "Richmond Street (East Deering), Portland [[2, STREET, 3.000, 2.95 km]]", - "Bryant Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.96 km]]", - "Pitt Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 2.96 km]]", - "Mount Vernon Street (Knightville), South Portland [[2, STREET, 3.000, 2.97 km]]", - "Watson Street (East Deering), Portland [[2, STREET, 3.000, 2.97 km]]", - "Lawrence Lano Street, South Portland [[2, STREET, 3.000, 2.98 km]]", - "Norwood Street (Woodfords Corner), Portland [[2, STREET, 3.000, 2.98 km]]", - "Savoy Street, Portland [[2, STREET, 3.000, 2.98 km]]", - "Caleb Street (Brighton Corner), Portland [[2, STREET, 3.000, 2.98 km]]", - "Davis Street (Willard Square), South Portland [[2, STREET, 3.000, 2.99 km]]", - "Cole Street (Pleasantdale), South Portland [[2, STREET, 3.000, 2.99 km]]", - "Upland Street, Portland [[2, STREET, 3.000, 2.99 km]]", - "Dalton Street (East Deering), Portland [[2, STREET, 3.000, 3.00 km]]", - "Johansen Street, Portland [[2, STREET, 3.000, 3.00 km]]", - "Vivian Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.00 km]]", - "Carroll Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.00 km]]", - "Island Street (East Deering), Portland [[2, STREET, 3.000, 3.00 km]]", - "Highland Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.00 km]]", - "Lassell Street, Portland [[2, STREET, 3.000, 3.00 km]]", - "Willard Street (Willard Square), South Portland [[2, STREET, 3.000, 3.02 km]]", - "Loveitt Street, South Portland [[2, STREET, 3.000, 3.04 km]]", - "Valley Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.04 km]]", - "Sullivan Street (East Deering), Portland [[2, STREET, 3.000, 3.04 km]]", - "Mayberry Street, South Portland [[2, STREET, 3.000, 3.05 km]]", - "Alton Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.05 km]]", - "Rackleff Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.05 km]]", - "Reynolds Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.05 km]]", - "Sawyer Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.06 km]]", - "Hoyt Street (Pleasantdale), South Portland [[2, STREET, 3.000, 3.06 km]]", - "Prospect Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.07 km]]", - "Edwards Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.07 km]]", - "Berkeley Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.08 km]]", - "Hodgins Street, Portland [[2, STREET, 3.000, 3.08 km]]", - "Fairfield Street (East Deering), Portland [[2, STREET, 3.000, 3.08 km]]", - "Clinton Street (Willard Square), South Portland [[2, STREET, 3.000, 3.09 km]]", - "Henry Street (Loveitts Field), South Portland [[2, STREET, 3.000, 3.09 km]]", - "Irving Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.10 km]]", - "Hanson Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.11 km]]", - "Orchard Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.12 km]]", - "Fayette Street, Portland [[2, STREET, 3.000, 3.12 km]]", - "Amherst Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.13 km]]", - "Deake Street, South Portland [[2, STREET, 3.000, 3.13 km]]", - "South Kelsey Street, South Portland [[2, STREET, 3.000, 3.13 km]]", - "Hunt Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.13 km]]", - "Mayland Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.14 km]]", - "Simonton Street, South Portland [[2, STREET, 3.000, 3.14 km]]", - "Latham Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.14 km]]", - "Bradley Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.15 km]]", - "Dirigo Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.15 km]]", - "West Kidder Street, Portland [[2, STREET, 3.000, 3.16 km]]", - "Goudy Street, South Portland [[2, STREET, 3.000, 3.16 km]]", - "Sterling Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.17 km]]", - "Mason Street (Deering Highlands), Portland [[2, STREET, 3.000, 3.18 km]]", - "Hamilton Street (Knightville), South Portland [[2, STREET, 3.000, 3.18 km]]", - "Somerset Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.19 km]]", - "Beaufort Street, South Portland [[2, STREET, 3.000, 3.20 km]]", - "Belknap Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.21 km]]", - "Ivy Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.21 km]]", - "Wylie Street, South Portland [[2, STREET, 3.000, 3.21 km]]", - "Charlotte Street (Willard Square), South Portland [[2, STREET, 3.000, 3.21 km]]", - "Veranda Street, Portland [[2, STREET, 3.000, 3.22 km]]", - "Minott Street, South Portland [[2, STREET, 3.000, 3.22 km]]", - "Wayne Street, Portland [[2, STREET, 3.000, 3.23 km]]", - "Dudley Street (East Deering), Portland [[2, STREET, 3.000, 3.23 km]]", - "Fernald Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.24 km]]", - "Bay Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.24 km]]", - "Saint Jude Street, Portland [[2, STREET, 3.000, 3.25 km]]", - "Florence Street (Meeting House Hill), South Portland [[2, STREET, 3.000, 3.25 km]]", - "Prentiss Street (East Deering), Portland [[2, STREET, 3.000, 3.26 km]]", - "Florence Street (Deering Center), Portland [[2, STREET, 3.000, 3.26 km]]", - "Oakley Street, Portland [[2, STREET, 3.000, 3.26 km]]", - "Dunscombe Street, South Portland [[2, STREET, 3.000, 3.27 km]]", - "Fairview Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.28 km]]", - "Morse Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.28 km]]", - "Lincoln Street (Ligonia), South Portland [[2, STREET, 3.000, 3.28 km]]", - "Saint Street, Portland [[2, STREET, 3.000, 3.28 km]]", - "Linwood Street, South Portland [[2, STREET, 3.000, 3.30 km]]", - "St Jude Street, Portland [[2, STREET, 3.000, 3.30 km]]", - "Arcadia Street, Portland [[2, STREET, 3.000, 3.31 km]]", - "Burnham Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.31 km]]", - "Jackson Street (Ligonia), South Portland [[2, STREET, 3.000, 3.33 km]]", - "Rosedale Street (East Deering), Portland [[2, STREET, 3.000, 3.33 km]]", - "Boody Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.33 km]]", - "Parrott Street, South Portland [[2, STREET, 3.000, 3.34 km]]", - "Frost Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.35 km]]", - "Inverness Street (East Deering), Portland [[2, STREET, 3.000, 3.35 km]]", - "Higgins Street (Deering Center), Portland [[2, STREET, 3.000, 3.35 km]]", - "Hutchinson Street (Ligonia), South Portland [[2, STREET, 3.000, 3.35 km]]", - "Hill Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.35 km]]", - "Hall Street, Portland [[2, STREET, 3.000, 3.36 km]]", - "Orkney Street, Portland [[2, STREET, 3.000, 3.36 km]]", - "Belfield Street, Portland [[2, STREET, 3.000, 3.37 km]]", - "Lombard Street (Stanwood Park), South Portland [[2, STREET, 3.000, 3.38 km]]", - "Bodge Street, South Portland [[2, STREET, 3.000, 3.38 km]]", - "Hawthorne Street (East Deering), Portland [[2, STREET, 3.000, 3.38 km]]", - "Tremont Street (Deering Center), Portland [[2, STREET, 3.000, 3.38 km]]", - "Osgood Street, Portland [[2, STREET, 3.000, 3.40 km]]", - "Woodford Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.40 km]]", - "Wordsworth Street, Portland [[2, STREET, 3.000, 3.41 km]]", - "Curtis Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.41 km]]", - "Whittier Street (East Deering), Portland [[2, STREET, 3.000, 3.41 km]]", - "Loraine Street, Portland [[2, STREET, 3.000, 3.42 km]]", - "Chandler Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.42 km]]", - "Concord Street (Deering Center), Portland [[2, STREET, 3.000, 3.42 km]]", - "Gately Street, South Portland [[2, STREET, 3.000, 3.43 km]]", - "James Street (Deering Center), Portland [[2, STREET, 3.000, 3.44 km]]", - "Woodbury Street (Loveitts Field), South Portland [[2, STREET, 3.000, 3.44 km]]", - "Billy Vachon Street, South Portland [[2, STREET, 3.000, 3.47 km]]", - "June Street (Brighton Corner), Portland [[2, STREET, 3.000, 3.47 km]]", - "Chapman Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.48 km]]", - "Caribou Street (Bradleys Corner), Portland [[2, STREET, 3.000, 3.48 km]]", - "Read Street (Woodfords Corner), Portland [[2, STREET, 3.000, 3.48 km]]", - "Matthews Street (Deering Center), Portland [[2, STREET, 3.000, 3.49 km]]", - "Motley Street (Rosemont), Portland [[2, STREET, 3.000, 3.50 km]]", - "Harding Street (Ligonia), South Portland [[2, STREET, 3.000, 3.50 km]]", - "Fenway Street, Portland [[2, STREET, 3.000, 3.51 km]]", - "Kineo Street, Portland [[2, STREET, 3.000, 3.51 km]]", - "Victoria Street (East Deering), Portland [[2, STREET, 3.000, 3.52 km]]", - "Frye Street, Portland [[2, STREET, 3.000, 3.52 km]]", - "East Kidder Street (East Deering), Portland [[2, STREET, 3.000, 3.52 km]]", - "Bay Street Extension, Portland [[2, STREET, 3.000, 3.52 km]]", - "Torrey Street, Portland [[2, STREET, 3.000, 3.52 km]]", - "Haywood Street, Portland [[2, STREET, 3.000, 3.53 km]]", - "Runnells Street (Rosemont), Portland [[2, STREET, 3.000, 3.54 km]]", - "Cranston Street, Portland [[2, STREET, 3.000, 3.54 km]]", - "Lake Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.54 km]]", - "Marlow Street, Portland [[2, STREET, 3.000, 3.55 km]]", - "Alton Street (Cash Corner), South Portland [[2, STREET, 3.000, 3.56 km]]", - "Kenilworth Street, Portland [[2, STREET, 3.000, 3.57 km]]", - "Vera Street, Portland [[2, STREET, 3.000, 3.58 km]]", - "Oregon Street, Portland [[2, STREET, 3.000, 3.58 km]]", - "South Grafton Street, Portland [[2, STREET, 3.000, 3.59 km]]", - "Cox Street, South Portland [[2, STREET, 3.000, 3.59 km]]", - "Bismark Street, Portland [[2, STREET, 3.000, 3.59 km]]", - "Providence Street (Lunts Corner), Portland [[2, STREET, 3.000, 3.60 km]]", - "Holly Street (Deering Center), Portland [[2, STREET, 3.000, 3.60 km]]", - "Cleveland Street (East Deering), Portland [[2, STREET, 3.000, 3.61 km]]", - "Sawyer Street (Knightville), South Portland [[2, STREET, 3.000, 3.61 km]]", - "Olympia Street, Portland [[2, STREET, 3.000, 3.61 km]]", - "Hartley Street (Deering Center), Portland [[2, STREET, 3.000, 3.61 km]]", - "Fellows Street (Rosemont), Portland [[2, STREET, 3.000, 3.62 km]]", - "Bancroft Street (Rosemont), Portland [[2, STREET, 3.000, 3.62 km]]" + "Portland Street, Yarmouth [[2, STREET, 3.000, 16.13 km]]", + "Portland Street, North Berwick [[2, STREET, 3.000, 54.37 km]]", + "Portland Street, Berwick [[2, STREET, 3.000, 59.60 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/navacerrada.json b/OsmAnd-java/src/test/resources/search/navacerrada.json index 5a53d967bd..e70a9fdc8d 100644 --- a/OsmAnd-java/src/test/resources/search/navacerrada.json +++ b/OsmAnd-java/src/test/resources/search/navacerrada.json @@ -11,18 +11,11 @@ }, "phrase": "Calle de las eras 5, Navacerrada", "results": [ - "5, Calle de las Eras (Uranización Los Corales), Navacerrada [[6, HOUSE, 0.430, 70.17 km]]", - "Calle de las Eras (Uranización Los Corales), Navacerrada [[5, STREET, 3.000, 70.15 km]]", - "Calle del Sotillo (Uranización Los Corales), Pasaje de las Eras (Uranización Los Corales), Navacerrada [[5, STREET_INTERSECTION, 0.430, 70.23 km]]", + "5, Calle de las Eras (Uranización Los Corales), Navacerrada [[6, HOUSE, 0.043, 70.17 km]]", + "Calle de las Eras (Uranización Los Corales), Navacerrada [[5, STREET, 0.310, 70.15 km]]" ], "extra-results": [ - "Calle del Puerto de Navacerrada, Las Nieves [[4, STREET, 3.000, 33.80 km]]", - "Calle Barrio de las Peñas, Navacerrada [[4, STREET, 3.000, 70.10 km]]", - "Calle de las Cruces (Residencial Sanabria), Navacerrada [[4, STREET, 3.000, 70.14 km]]", - "Calle de las Escuelas, Navacerrada [[4, STREET, 3.000, 70.17 km]]", - "Calle de las Huertas (Residencial Sanabria), Navacerrada [[4, STREET, 3.000, 70.18 km]]", - "Calle de la Virgen de las Nieves, Puerto de Navacerrada [[4, STREET, 3.000, 74.59 km]]", - "Pasaje de las Eras (Uranización Los Corales), Navacerrada [[4, STREET, 3.000, 70.23 km]]", + "5, Calle Navacerrada (Urb. Las Suertes), Las Suertes [[4, HOUSE, 0.430, 60.50 km]]", "50, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.37 km]]", "52, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.36 km]]", @@ -33,46 +26,14 @@ "57, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.37 km]]", "58, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.35 km]]", "59, Calle de Francisco Navacerrada, Salamanca [[4, HOUSE, 0.430, 26.35 km]]", - "Calle Puerto de Navacerrada, La Poveda [[3, STREET, 3.000, 11.22 km]]", - "Calle del Embalse de Navacerrada, Villa de Vallecas [[3, STREET, 3.000, 17.17 km]]", - "Calle del Puerto de Navacerrada, Puente de Vallecas [[3, STREET, 3.000, 22.95 km]]", - "Calle de Francisco Navacerrada, Salamanca [[3, STREET, 3.000, 26.39 km]]", - "Calle de Navacerrada, Moraleja de Enmedio [[3, STREET, 3.000, 29.38 km]]", - "Calle Navacerrada (Urb. Las Suertes), Las Suertes [[3, STREET, 3.000, 60.58 km]]", - "Calle Puerto de Navacerrada, Roman Candelas [[3, STREET, 3.000, 62.20 km]]", - "Calle Navacerrada, Becerril de la Sierra [[3, STREET, 3.000, 67.77 km]]", - "Calle de Ángel Rojas, Navacerrada [[3, STREET, 3.000, 69.64 km]]", - "Calle de los Robles (Uranización Los Corales), Navacerrada [[3, STREET, 3.000, 69.84 km]]", - "Calle de los Enebros (Uranización Los Corales), Navacerrada [[3, STREET, 3.000, 69.90 km]]", - "Calle de la Bola del Mundo (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 69.92 km]]", - "Calle de la Maliciosa (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 69.96 km]]", - "Calle de la Perdiz, Navacerrada [[3, STREET, 3.000, 70.03 km]]", - "Calle de la Magdalena, Navacerrada [[3, STREET, 3.000, 70.08 km]]", - "Calle las Jaras, Navacerrada [[3, STREET, 3.000, 70.12 km]]", - "Calle de la Audiencia, Navacerrada [[3, STREET, 3.000, 70.16 km]]", - "Calle de Prado Jerez, Navacerrada [[3, STREET, 3.000, 70.19 km]]", - "Calle de Carmen Conde (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.23 km]]", - "Calle de la Iglesia, Navacerrada [[3, STREET, 3.000, 70.24 km]]", - "Calle de la Tejera, Navacerrada [[3, STREET, 3.000, 70.27 km]]", - "Calle de la Encinilla, Navacerrada [[3, STREET, 3.000, 70.30 km]]", - "Calle de la Canaleja (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.32 km]]", - "Calle de Rafael Alvarado, Navacerrada [[3, STREET, 3.000, 70.33 km]]", - "Calle de Andrés Segovia, Navacerrada [[3, STREET, 3.000, 70.35 km]]", - "Calle de los Pradillos (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.39 km]]", - "Calle de Abel, Navacerrada [[3, STREET, 3.000, 70.42 km]]", - "Calle Praderas de San Sebastián, Navacerrada [[3, STREET, 3.000, 70.44 km]]", - "Calle de San Sebastián (Residencial Sanabria), Navacerrada [[3, STREET, 3.000, 70.57 km]]", - "Calle de Álvaro Iglesia, Navacerrada [[3, STREET, 3.000, 70.58 km]]", - "Calle de los Arcos, Navacerrada [[3, STREET, 3.000, 70.69 km]]", - "Calle de Peñalara, Puerto de Navacerrada [[3, STREET, 3.000, 74.64 km]]", - "Calle de la Bola del Mundo, Puerto de Navacerrada [[3, STREET, 3.000, 74.71 km]]", - "Calle de la Estación, Puerto de Navacerrada [[3, STREET, 3.000, 74.73 km]]", - "Calle Ginos, Puerto de Navacerrada [[3, STREET, 3.000, 74.76 km]]", - "Calle Vitoria, Puerto de Navacerrada [[3, STREET, 3.000, 74.77 km]]", - "Calle Dos Castillas, Puerto de Navacerrada [[3, STREET, 3.000, 74.96 km]]", - "Travesía de las Huertas, Navacerrada [[3, STREET, 3.000, 70.12 km]]", - "Carretera de Collado Villalba a Navacerrada, El Baillo y las Hojarascas [[3, STREET, 3.000, 72.83 km]]", - "Vereda de las Encinillas, Navacerrada [[3, STREET, 3.000, 75.21 km]]", + "Pasaje de las Eras (Uranización Los Corales), Navacerrada [[4, STREET, 0.310, 70.23 km]]", + "Calle del Puerto de Navacerrada, Las Nieves [[4, STREET, 0.310, 33.80 km]]", + "Calle Barrio de las Peñas, Navacerrada [[4, STREET, 0.310, 70.10 km]]", + "Calle de las Cruces (Residencial Sanabria), Navacerrada [[4, STREET, 0.310, 70.14 km]]", + "Calle de las Escuelas, Navacerrada [[4, STREET, 0.310, 70.17 km]]", + "Calle de las Huertas (Residencial Sanabria), Navacerrada [[4, STREET, 0.310, 70.18 km]]", + "Calle de la Virgen de las Nieves, Puerto de Navacerrada [[4, STREET, 0.310, 74.59 km]]", + "Calle del Sotillo (Uranización Los Corales), Pasaje de las Eras (Uranización Los Corales), Navacerrada [[4, STREET_INTERSECTION, 0.043, 70.23 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/spring_street.json b/OsmAnd-java/src/test/resources/search/spring_street.json index a5dfdc530c..ae94086499 100644 --- a/OsmAnd-java/src/test/resources/search/spring_street.json +++ b/OsmAnd-java/src/test/resources/search/spring_street.json @@ -11,11 +11,10 @@ }, "phrase": "spring street", "results": [ - "Spring (Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Spring (Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", "Spring (Spring / Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", "Spring (Ice rink / Sport) [[1, POI_TYPE, 1.000, 0.00 km]]", "Spring (Bridge / Transport construction) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Spring Street, Cold Spring Harbor [[3, STREET, 0.310, 56.10 km]]", "Spring Street, South Nyack [[2, STREET, 3.000, 10.57 km]]", "Spring Street, Tomkins Cove [[2, STREET, 3.000, 16.77 km]]", "Spring Street, Southfields [[2, STREET, 3.000, 18.10 km]]", @@ -35,6 +34,7 @@ "Spring Street, Montgomery [[2, STREET, 3.000, 48.53 km]]", "Spring Street, Chelsea [[2, STREET, 3.000, 49.19 km]]", "Spring Street, Wappingers Falls [[2, STREET, 3.000, 55.17 km]]", + "Spring Street, Cold Spring Harbor [[2, STREET, 3.000, 56.10 km]]", "Spring Street, Staten Island [[2, STREET, 3.000, 56.86 km]]", "Spring Street, East Meadow [[2, STREET, 3.000, 59.81 km]]", "Spring Street, Inwood [[2, STREET, 3.000, 60.63 km]]", @@ -139,10 +139,6 @@ "Kraw Street, Spring Glen [[2, STREET, 0.310, 69.40 km]]", "Munro Street, Cold Spring [[2, STREET, 0.310, 292.27 km]]", "State Street, Cold Spring [[2, STREET, 0.310, 292.31 km]]", - "Cold Spring, Cold Spring [[2, STREET, 0.310, 34.42 km]]", - "Spring Hill Road, Cold Spring Harbor [[2, STREET, 0.310, 55.96 km]]", - "Spring, Cold Spring Harbor [[2, STREET, 0.310, 56.22 km]]", - "Spring Road, Cold Spring Harbor [[2, STREET, 0.310, 56.79 km]]", "Market Street, Cold Spring [[2, STREET, 0.310, 34.29 km]]", "New Street, Cold Spring [[2, STREET, 0.310, 34.40 km]]", "Fish Street, Cold Spring [[2, STREET, 0.310, 34.51 km]]", diff --git a/OsmAnd-java/src/test/resources/search/street_santa_clara.json b/OsmAnd-java/src/test/resources/search/street_santa_clara.json index aeb4e2f2ce..3c5b50324a 100644 --- a/OsmAnd-java/src/test/resources/search/street_santa_clara.json +++ b/OsmAnd-java/src/test/resources/search/street_santa_clara.json @@ -61,7 +61,8 @@ "Santa Clara del Mullol [[2, POI, 2.000, 137.89 km]]", "Plaça de la Mare Santa Clara [[2, POI, 2.000, 166.36 km]]", "Pujada de Santa Clara [[2, POI, 2.000, 196.30 km]]", - "Carrer Nou de Santa Clara [[2, POI, 2.000, 196.39 km]]" + "Carrer Nou de Santa Clara [[2, POI, 2.000, 196.39 km]]", + "Carrer Clara Campoamor, Santa Coloma de Gramenet [[2, STREET, 0.310, 39.00 km]]" ], "amenities": [ From 84c7fd425b47342ce8363951bfda682828a9b9ec Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 4 Jun 2020 15:55:46 +0200 Subject: [PATCH 26/26] Fix tests --- .../osmand/search/core/SearchCoreFactory.java | 3 +- .../net/osmand/search/core/SearchPhrase.java | 8 +- .../src/test/resources/search/bank_abcd.json | 37 ++++---- .../test/resources/search/burger_king.json | 85 +++++-------------- .../test/resources/search/double_parking.json | 70 +++++++++++---- .../test/resources/search/poi_biergarten.json | 70 ++++++++++++--- .../test/resources/search/spring_street.json | 3 - 7 files changed, 156 insertions(+), 120 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index da260b1493..33214cabf6 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -746,7 +746,8 @@ public class SearchCoreFactory { } } else { - Map> poiTypes = getPoiTypeResults(nm, true); + boolean includeAdditional = !phrase.hasMoreThanOneUnknownSearchWord(); + Map> poiTypes = getPoiTypeResults(nm, includeAdditional); for (Entry> pt : poiTypes.entrySet()) { boolean match = !phrase.isFirstUnknownSearchWordComplete(); if (!match) { diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index e9d34bd255..b7050cd943 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -202,7 +202,7 @@ public class SearchPhrase { sp.words = foundWords; sp.fullTextSearchPhrase = fullText; sp.unknownSearchPhrase = textToSearch; - + sp.lastUnknownSearchWordComplete = isTextComplete(fullText) ; if (!reg.matcher(textToSearch).find()) { sp.firstUnknownSearchWord = sp.unknownSearchPhrase.trim(); } else { @@ -211,7 +211,9 @@ public class SearchPhrase { boolean first = true; for (int i = 0; i < ws.length ; i++) { String wd = ws[i].trim(); - if (wd.length() > 0 && !conjunctions.contains(wd.toLowerCase())) { + boolean conjunction = conjunctions.contains(wd.toLowerCase()); + boolean lastAndIncomplete = i == ws.length - 1 && !sp.lastUnknownSearchWordComplete; + if (wd.length() > 0 && (!conjunction || lastAndIncomplete)) { if (first) { sp.firstUnknownSearchWord = wd; first = false; @@ -221,7 +223,7 @@ public class SearchPhrase { } } } - sp.lastUnknownSearchWordComplete = isTextComplete(fullText) ; + return sp; } diff --git a/OsmAnd-java/src/test/resources/search/bank_abcd.json b/OsmAnd-java/src/test/resources/search/bank_abcd.json index 86aaae239e..75710cc36c 100644 --- a/OsmAnd-java/src/test/resources/search/bank_abcd.json +++ b/OsmAnd-java/src/test/resources/search/bank_abcd.json @@ -11,25 +11,24 @@ }, "phrase": "Bank dr", "results": [ - "Bank (Finance)", - "Hohe-Bank-Weg, Königswartha - Rakecy", - "Dresdner Bank", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Filiale Dresden Technische Universität", - "Ostsächsische Sparkasse Dresden", - "Volksbank Raiffeisenbank Dresden", - "Ostsächsische Sparkasse Dresden Zwst. Strehlen", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Dresdner Volksbank Raiffeisenbank", - "Ostsächsische Sparkasse Filiale Dresden Wilder Mann", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Ostsächsische Sparkasse Dresden", - "Dresdner Volksbank Raiffeisenbank eG" + "Bank (Finance) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Dresdner Bank [[2, POI, 2.000, 0.10 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 1.46 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 2.15 km]]", + "Filiale Dresden Technische Universität [[2, POI, 2.000, 2.61 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 2.68 km]]", + "Volksbank Raiffeisenbank Dresden [[2, POI, 2.000, 2.77 km]]", + "Ostsächsische Sparkasse Dresden Zwst. Strehlen [[2, POI, 2.000, 2.86 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 3.42 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 3.74 km]]", + "Dresdner Volksbank Raiffeisenbank [[2, POI, 2.000, 4.72 km]]", + "Ostsächsische Sparkasse Filiale Dresden Wilder Mann [[2, POI, 2.000, 5.06 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 7.42 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 7.44 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 7.57 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 8.06 km]]", + "Ostsächsische Sparkasse Dresden [[2, POI, 2.000, 8.83 km]]", + "Dresdner Volksbank Raiffeisenbank eG [[2, POI, 2.000, 8.97 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/burger_king.json b/OsmAnd-java/src/test/resources/search/burger_king.json index 75fdcadb36..3108612856 100644 --- a/OsmAnd-java/src/test/resources/search/burger_king.json +++ b/OsmAnd-java/src/test/resources/search/burger_king.json @@ -11,73 +11,26 @@ }, "phrase": "Burger King", "results": [ - "Burger (Cafe / Cafe and restaurant) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Burger (Pub / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Burger (Bar / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Burger (Restaurant / Cafe and restaurant) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Burger (Biergarten / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Burger (Fast food / Food) [[1, POI_TYPE, 1.000, 0.00 km]]", "Burger King Thiendorf [[2, POI, 2.000, 46.35 km]]", - "Burger King [[2, POI, 2.000, 46.75 km]]", - "Burger King [[2, POI, 2.000, 57.61 km]]", - "Burger King [[2, POI, 2.000, 58.23 km]]", - "Burger King [[2, POI, 2.000, 59.20 km]]", - "Burger King [[2, POI, 2.000, 66.93 km]]", - "Burger King Riesa [[2, POI, 2.000, 78.15 km]]", - "Burger King [[2, POI, 2.000, 118.29 km]]", - "Bürger King Chemnitz [[2, POI, 2.000, 121.13 km]]", - "Burger King Chemnitz [[2, POI, 2.000, 123.17 km]]", - "Burger King [[2, POI, 2.000, 135.11 km]]", - "Burger King [[2, POI, 2.000, 139.54 km]]", - "Burger King [[2, POI, 2.000, 139.98 km]]", - "Burger King [[2, POI, 2.000, 140.17 km]]", - "Burger King Glauchau [[2, POI, 2.000, 142.15 km]]", - "Burger King [[2, POI, 2.000, 144.43 km]]", - "Burger King [[2, POI, 2.000, 146.38 km]]", - "Burger King [[2, POI, 2.000, 147.72 km]]", - "Burger King [[2, POI, 2.000, 148.27 km]]", - "Burger King [[2, POI, 2.000, 151.57 km]]", - "Burger Straße 2, Lohsa - Łaz [[1, STREET, 3.000, 6.55 km]]", - "Burger Straße, Lohsa - Łaz [[1, STREET, 3.000, 6.74 km]]", - "Burger Straße 2 [[1, POI, 2.000, 6.56 km]]", - "Beat’n’Burger [[1, POI, 2.000, 56.07 km]]", - "Burgerclub 13 [[1, POI, 2.000, 56.14 km]]", - "Burgermeister [[1, POI, 2.000, 56.18 km]]", - "Burgerheart [[1, POI, 2.000, 56.28 km]]", - "burgerei [[1, POI, 2.000, 58.04 km]]", - "Rock Burger [[1, POI, 2.000, 58.62 km]]", - "Burgerlich [[1, POI, 2.000, 58.73 km]]", - "Bürger Augenoptik [[1, POI, 2.000, 60.75 km]]", - "Burger-Werk [[1, POI, 2.000, 65.07 km]]", - "Bürger- und Vereinshaus [[1, POI, 2.000, 76.72 km]]", - "Burger Cafe Kultur [[1, POI, 2.000, 92.76 km]]", - "Dr. med. Ulrich Bürger [[1, POI, 2.000, 94.32 km]]", - "Bürger-Schützen-Gilde 1470 Wurzen e.V. [[1, POI, 2.000, 115.91 km]]", - "SUMO Burger [[1, POI, 2.000, 117.31 km]]", - "Photovoltaikanlage Freibad Bürger Energie Drebach eG [[1, POI, 2.000, 122.52 km]]", - "ALFS burger & pizza [[1, POI, 2.000, 126.09 km]]", - "Bürger- und Vereinshaus [[1, POI, 2.000, 129.35 km]]", - "Bürger- und Vereinshaus Rittergut [[1, POI, 2.000, 131.71 km]]", - "Bürger-Schützengesellschaft 1857 Taucha e.V. [[1, POI, 2.000, 133.21 km]]", - "Meyer Burger (Germany) AG [[1, POI, 2.000, 135.57 km]]", - "Bürger- und Familienpark Oelsnitz [[1, POI, 2.000, 138.38 km]]", - "Bürger- und Berggasthaus Scheibenberg [[1, POI, 2.000, 138.63 km]]", - "Max-Bürger-Forschungszentrum [[1, POI, 2.000, 138.92 km]]", - "Peter Pane Burgergrill & Bar [[1, POI, 2.000, 139.96 km]]", - "Prime Burger [[1, POI, 2.000, 140.14 km]]", - "Bistro Burger [[1, POI, 2.000, 140.46 km]]", - "Burgerheart [[1, POI, 2.000, 140.47 km]]", - "Burger Like [[1, POI, 2.000, 140.77 km]]", - "burgerme [[1, POI, 2.000, 141.03 km]]", - "Bistro Burger & Co [[1, POI, 2.000, 141.52 km]]", - "Burger-Amt Adler [[1, POI, 2.000, 143.11 km]]", - "Burger Amt #2 [[1, POI, 2.000, 143.51 km]]", - "Parfümerie Burger [[1, POI, 2.000, 151.50 km]]", - "Parfümerie Burger [[1, POI, 2.000, 153.16 km]]", - "Bürger-Begegnungszentrum [[1, POI, 2.000, 178.53 km]]", - "Burger 25 [[1, POI, 2.000, 186.78 km]]", - "Merkur [[0, POI, 2.000, 58.62 km]]", - "Bahnhof Kurort Kipsdorf [[0, POI, 2.000, 80.96 km]]" + "Burger King [[2, POI, 2.000, 46.75 km]]", + "Burger King [[2, POI, 2.000, 57.61 km]]", + "Burger King [[2, POI, 2.000, 58.23 km]]", + "Burger King [[2, POI, 2.000, 59.20 km]]", + "Burger King [[2, POI, 2.000, 66.93 km]]", + "Burger King Riesa [[2, POI, 2.000, 78.15 km]]", + "Burger King [[2, POI, 2.000, 118.29 km]]", + "Bürger King Chemnitz [[2, POI, 2.000, 121.13 km]]", + "Burger King Chemnitz [[2, POI, 2.000, 123.17 km]]", + "Burger King [[2, POI, 2.000, 135.11 km]]", + "Burger King [[2, POI, 2.000, 139.54 km]]", + "Burger King [[2, POI, 2.000, 139.98 km]]", + "Burger King [[2, POI, 2.000, 140.17 km]]", + "Burger King Glauchau [[2, POI, 2.000, 142.15 km]]", + "Burger King [[2, POI, 2.000, 144.43 km]]", + "Burger King [[2, POI, 2.000, 146.38 km]]", + "Burger King [[2, POI, 2.000, 147.72 km]]", + "Burger King [[2, POI, 2.000, 148.27 km]]", + "Burger King [[2, POI, 2.000, 151.57 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/double_parking.json b/OsmAnd-java/src/test/resources/search/double_parking.json index 46abccb8d1..c3812aae31 100644 --- a/OsmAnd-java/src/test/resources/search/double_parking.json +++ b/OsmAnd-java/src/test/resources/search/double_parking.json @@ -9,24 +9,60 @@ "emptyQueryAllowed": false, "sortByName": false }, - "phrase": "parking", + "phrase": "parking ", "results": [ - "Parking (Personal transport)", - "Parking entrance (Personal transport)", - "Parking fee (Charging station / Transportation)", - "Parking fee: no (Charging station / Transportation)", - "Parking fee: yes (Charging station / Transportation)", - "Parking lot (Fire hydrant / Emergency infrastructure)", - "Parking space (Personal transport)", - "Parking tickets (Vending machine / Store)", - "Parking tickets (Vending machine / Store)", - "Parking time limit (Parking / Personal transport)", - "Bicycle parking (Bicycle transport)", - "Motorcycle parking (Personal transport)", - "Parking", - "Parking", - "Parking", - "Parking" + "Parking (Personal transport) [[1, POI_TYPE, 1.000, 0.00 km]]", + "для посетителей [[0, POI, 2.000, 0.03 km]]", + "Parking [[0, POI, 2.000, 0.05 km]]", + "Parking [[0, POI, 2.000, 0.11 km]]", + "Parking [[0, POI, 2.000, 0.16 km]]", + "Parking [[0, POI, 2.000, 0.17 km]]", + "Parking [[0, POI, 2.000, 0.23 km]]", + "Parking [[0, POI, 2.000, 0.35 km]]", + "Parking [[0, POI, 2.000, 0.40 km]]", + "Parking [[0, POI, 2.000, 0.48 km]]", + "Parking [[0, POI, 2.000, 0.49 km]]", + "Parking [[0, POI, 2.000, 0.55 km]]", + "Автостоянка №1 [[0, POI, 2.000, 0.56 km]]", + "Parking [[0, POI, 2.000, 0.58 km]]", + "Parking [[0, POI, 2.000, 0.61 km]]", + "Parking [[0, POI, 2.000, 0.72 km]]", + "Parking [[0, POI, 2.000, 0.81 km]]", + "Parking [[0, POI, 2.000, 0.81 km]]", + "Parking [[0, POI, 2.000, 0.85 km]]", + "для клиентов [[0, POI, 2.000, 0.89 km]]", + "Parking [[0, POI, 2.000, 0.93 km]]", + "Parking [[0, POI, 2.000, 0.94 km]]", + "Заинская ГРЭС [[0, POI, 2.000, 1.01 km]]", + "Parking [[0, POI, 2.000, 1.02 km]]", + "Южная [[0, POI, 2.000, 1.03 km]]", + "Parking [[0, POI, 2.000, 1.06 km]]", + "Parking [[0, POI, 2.000, 1.09 km]]", + "Parking [[0, POI, 2.000, 1.10 km]]", + "Служебная [[0, POI, 2.000, 1.14 km]]", + "Parking [[0, POI, 2.000, 1.20 km]]", + "Parking [[0, POI, 2.000, 1.21 km]]", + "Parking [[0, POI, 2.000, 1.36 km]]", + "Parking [[0, POI, 2.000, 1.44 km]]", + "Три тополя [[0, POI, 2.000, 1.47 km]]", + "Parking [[0, POI, 2.000, 1.53 km]]", + "Parking [[0, POI, 2.000, 1.56 km]]", + "Parking [[0, POI, 2.000, 1.62 km]]", + "Parking [[0, POI, 2.000, 1.85 km]]", + "Штрафстоянка (Эвакуатор) [[0, POI, 2.000, 2.03 km]]", + "Parking [[0, POI, 2.000, 2.05 km]]", + "для регистрации в ГИБДД [[0, POI, 2.000, 2.06 km]]", + "Parking [[0, POI, 2.000, 2.06 km]]", + "Parking [[0, POI, 2.000, 2.07 km]]", + "для техосмотра [[0, POI, 2.000, 2.09 km]]", + "Parking [[0, POI, 2.000, 2.18 km]]", + "Parking [[0, POI, 2.000, 2.55 km]]", + "Parking [[0, POI, 2.000, 3.40 km]]", + "Parking [[0, POI, 2.000, 3.41 km]]", + "Parking [[0, POI, 2.000, 3.41 km]]", + "Parking [[0, POI, 2.000, 3.45 km]]", + "Parking [[0, POI, 2.000, 4.29 km]]", + "Parking [[0, POI, 2.000, 6.71 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/poi_biergarten.json b/OsmAnd-java/src/test/resources/search/poi_biergarten.json index 362e58f4d7..63c19b794f 100644 --- a/OsmAnd-java/src/test/resources/search/poi_biergarten.json +++ b/OsmAnd-java/src/test/resources/search/poi_biergarten.json @@ -9,18 +9,66 @@ "emptyQueryAllowed": false, "sortByName": false }, - "phrase": "Biergarten", + "phrase": "Biergarten ", "results": [ - "Biergarten (Food)", - "Biergarten Italienisches Dörfchen", - "Biergarten Narrenhäus'l", - "Biergarten Elbsegler", - "Biergarten Elbsegler", - "Biergarten", - "Biergarten", - "Biergarten", - "Biergarten", - "Biergarten" + "Biergarten (Food) [[1, POI_TYPE, 1.000, 0.00 km]]", + "Biergarten Italienisches Dörfchen [[1, POI, 2.000, 0.55 km]]", + "Biergarten Narrenhäus'l [[1, POI, 2.000, 0.84 km]]", + "Biergarten Elbsegler [[1, POI, 2.000, 0.89 km]]", + "Biergarten Elbsegler [[1, POI, 2.000, 0.90 km]]", + "Körnergarten [[1, POI, 2.000, 5.18 km]]", + "Biergarten Goldener Anker [[1, POI, 2.000, 9.78 km]]", + "Palais Bistro [[0, POI, 2.000, 0.29 km]]", + "Augustus Garten am Narrenhäusl [[0, POI, 2.000, 0.88 km]]", + "Zum Schießhaus [[0, POI, 2.000, 0.96 km]]", + "Biergarten [[0, POI, 2.000, 1.24 km]]", + "Wachstube [[0, POI, 2.000, 1.24 km]]", + "Torwirtschaft [[0, POI, 2.000, 1.27 km]]", + "Altes Wettbüro [[0, POI, 2.000, 1.77 km]]", + "Bottoms Up [[0, POI, 2.000, 2.16 km]]", + "Louisengarten [[0, POI, 2.000, 2.20 km]]", + "Biergarten [[0, POI, 2.000, 2.28 km]]", + "Fährgarten Johannstadt [[0, POI, 2.000, 2.42 km]]", + "Carolaschlösschen [[0, POI, 2.000, 2.53 km]]", + "Alt-Dresden [[0, POI, 2.000, 2.75 km]]", + "Biergarten [[0, POI, 2.000, 2.90 km]]", + "Café & Restaurant Saite [[0, POI, 2.000, 3.09 km]]", + "Brauhaus am Waldschlößchen [[0, POI, 2.000, 3.45 km]]", + "Brauhaus Watzke [[0, POI, 2.000, 3.51 km]]", + "el Horst [[0, POI, 2.000, 3.67 km]]", + "Biergarten [[0, POI, 2.000, 3.74 km]]", + "Spitzwegerich [[0, POI, 2.000, 3.81 km]]", + "Biergarten [[0, POI, 2.000, 3.88 km]]", + "Biergarten [[0, POI, 2.000, 4.46 km]]", + "Trobischhof [[0, POI, 2.000, 4.48 km]]", + "Biergarten [[0, POI, 2.000, 4.80 km]]", + "Biergarten [[0, POI, 2.000, 4.91 km]]", + "Schillergarten [[0, POI, 2.000, 4.97 km]]", + "Biergarten [[0, POI, 2.000, 5.11 km]]", + "Biergarten [[0, POI, 2.000, 5.13 km]]", + "Demnitz Elbegarten [[0, POI, 2.000, 5.16 km]]", + "Körnergarten [[0, POI, 2.000, 5.18 km]]", + "Biergarten [[0, POI, 2.000, 5.31 km]]", + "Trachauer Sommergarten [[0, POI, 2.000, 5.31 km]]", + "Biergarten [[0, POI, 2.000, 5.91 km]]", + "Biergarten [[0, POI, 2.000, 6.12 km]]", + "Biergarten [[0, POI, 2.000, 6.26 km]]", + "Biergarten [[0, POI, 2.000, 6.42 km]]", + "Biergarten [[0, POI, 2.000, 6.88 km]]", + "Biergarten [[0, POI, 2.000, 7.11 km]]", + "Straußenwirtschaft Weingut Pesterwitz [[0, POI, 2.000, 7.14 km]]", + "Klotzscher Sommerwirtschaft [[0, POI, 2.000, 7.16 km]]", + "Biergarten [[0, POI, 2.000, 7.17 km]]", + "Zacke [[0, POI, 2.000, 8.20 km]]", + "Weingut Seifert [[0, POI, 2.000, 8.50 km]]", + "Biergarten [[0, POI, 2.000, 8.82 km]]", + "Biergarten [[0, POI, 2.000, 9.11 km]]", + "Biergarten [[0, POI, 2.000, 9.23 km]]", + "Landgut Hofewiese [[0, POI, 2.000, 9.40 km]]", + "Biergarten Goldener Anker [[0, POI, 2.000, 9.78 km]]", + "Biergarten [[0, POI, 2.000, 10.00 km]]", + "Biergarten [[0, POI, 2.000, 10.22 km]]", + "Besenwirtschaft Steinrücken [[0, POI, 2.000, 10.85 km]]" ], "amenities": [ { diff --git a/OsmAnd-java/src/test/resources/search/spring_street.json b/OsmAnd-java/src/test/resources/search/spring_street.json index ae94086499..d489ddc6d2 100644 --- a/OsmAnd-java/src/test/resources/search/spring_street.json +++ b/OsmAnd-java/src/test/resources/search/spring_street.json @@ -12,9 +12,6 @@ "phrase": "spring street", "results": [ "Spring (Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Spring (Spring / Natural) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Spring (Ice rink / Sport) [[1, POI_TYPE, 1.000, 0.00 km]]", - "Spring (Bridge / Transport construction) [[1, POI_TYPE, 1.000, 0.00 km]]", "Spring Street, South Nyack [[2, STREET, 3.000, 10.57 km]]", "Spring Street, Tomkins Cove [[2, STREET, 3.000, 16.77 km]]", "Spring Street, Southfields [[2, STREET, 3.000, 18.10 km]]",