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

Method LooksLikeHouseNumber

libs/indexer/feature_data.cpp:306–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306bool FeatureParams::LooksLikeHouseNumber(std::string const & hn)
307{
308 // Very naive implementation to _lightly_ promote hn -> name (for search index) if suitable.
309 /// @todo Conform with search::LooksLikeHouseNumber.
310
311 ASSERT(!hn.empty(), ());
312 size_t const sz = hn.size();
313 return strings::IsASCIIDigit(hn[0]) || (sz == 1 && strings::IsASCIILatin(hn[0])) ||
314 std::count_if(hn.begin(), hn.end(), &strings::IsASCIIDigit) > 0.2 * sz;
315}
316
317char const * FeatureParams::kHNLogTag = "HNLog";
318

Callers

nothing calls this directly

Calls 7

ASSERTFunction · 0.85
IsASCIIDigitFunction · 0.85
IsASCIILatinFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected