Support dots in street names - https://github.com/osmandapp/Osmand/issues/6154
This commit is contained in:
parent
54c0510bbe
commit
8298dbdf17
2 changed files with 15 additions and 1 deletions
|
@ -33,7 +33,16 @@ public class CollatorStringMatcher implements StringMatcher {
|
|||
|
||||
public CollatorStringMatcher(String part, StringMatcherMode mode) {
|
||||
this.collator = OsmAndCollator.primaryCollator();
|
||||
this.part = simplifyStringAndAlignChars(part);
|
||||
part = simplifyStringAndAlignChars(part);
|
||||
if (part.length() > 0 && part.charAt(part.length() - 1) == '.') {
|
||||
part = part.substring(0, part.length() - 1);
|
||||
if (mode == StringMatcherMode.CHECK_EQUALS_FROM_SPACE) {
|
||||
mode = StringMatcherMode.CHECK_STARTS_FROM_SPACE;
|
||||
} else if (mode == StringMatcherMode.CHECK_EQUALS) {
|
||||
mode = StringMatcherMode.CHECK_ONLY_STARTS_WITH;
|
||||
}
|
||||
}
|
||||
this.part = part;
|
||||
this.mode = mode;
|
||||
|
||||
}
|
||||
|
|
|
@ -281,6 +281,11 @@ public class SearchPhrase {
|
|||
for (String s : searchWords) {
|
||||
if (s.length() > 0 && !Character.isDigit(s.charAt(0)) && !LocationParser.isValidOLC(s)) {
|
||||
mainUnknownWordToSearch = s.trim();
|
||||
if (mainUnknownWordToSearch.endsWith(".")) {
|
||||
mainUnknownWordToSearch = mainUnknownWordToSearch.substring(0,
|
||||
mainUnknownWordToSearch.length() - 1);
|
||||
mainUnknownSearchWordComplete = false;
|
||||
}
|
||||
int unknownInd = unknownSearchWords.indexOf(s);
|
||||
if (!lastUnknownSearchWordComplete && unknownSearchWords.size() - 1 == unknownInd) {
|
||||
mainUnknownSearchWordComplete = false;
|
||||
|
|
Loading…
Reference in a new issue