MCPcopy Create free account
hub / github.com/comaps/comaps / GetNormalizedStreetName

Function GetNormalizedStreetName

libs/indexer/search_string_utils.cpp:615–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615strings::UniString GetNormalizedStreetName(std::string_view name)
616{
617 static StreetsDirectionsHolder s_directions;
618 static StreetsAbbreviationsHolder s_abbrev;
619
620 UniString res, abbrev, dir;
621 Tokenize(name, kStreetTokensSeparator, [&](std::string_view v)
622 {
623 UniString s = NormalizeAndSimplifyString(v);
624
625 if (s_abbrev.ApplyIf(s, [&abbrev](UniString const & s) { abbrev.append(s); }))
626 return;
627 if (s_directions.ApplyIf(s, [&dir](UniString const & s) { dir.append(s); }))
628 return;
629
630 EraseDummyStreetChars(s);
631 res.append(s);
632 });
633
634 res.append(abbrev);
635 res.append(dir);
636 return res;
637}
638
639bool IsStreetSynonym(UniString const & s)
640{

Callers 2

MatchMethod · 0.85
UNIT_TESTFunction · 0.85

Calls 5

EraseDummyStreetCharsFunction · 0.85
ApplyIfMethod · 0.80
TokenizeFunction · 0.50
appendMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68