diff options
author | vng <viktor.govako@gmail.com> | 2012-08-24 19:18:29 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:42:33 +0300 |
commit | 158dcec50d16e5e5414fbb97518f5be1111c204d (patch) | |
tree | b83c020d03d6565e85cc61d252175a781e685726 /search | |
parent | 973f995ad0c0ee0662086b1fe1c81a6d5fd6f05d (diff) |
[search] Fix spelling and code style.
Diffstat (limited to 'search')
-rw-r--r-- | search/search_query.cpp | 22 | ||||
-rw-r--r-- | search/search_query.hpp | 1 |
2 files changed, 12 insertions, 11 deletions
diff --git a/search/search_query.cpp b/search/search_query.cpp index 7b6a407431..235d5a1553 100644 --- a/search/search_query.cpp +++ b/search/search_query.cpp @@ -695,7 +695,7 @@ Query::Params::Params(Query const & q, bool isLocalities/* = false*/) for (size_t i = 0; i < tokensCount; ++i) m_tokens[i].push_back(q.m_tokens[i]); - // Add names of categories (and synonims). + // Add names of categories (and synonyms). if (q.m_pCategories && !isLocalities) { for (size_t i = 0; i < tokensCount; ++i) @@ -795,9 +795,9 @@ namespace impl typedef strings::UniString StringT; typedef buffer_vector<StringT, 32> TokensArrayT; - size_t GetSynonimTokenLength(TokensArrayT const & tokens, StringT const & prefix) const + size_t GetSynonymTokenLength(TokensArrayT const & tokens, StringT const & prefix) const { - // check only one token as a synonim + // check only one token as a synonym if (m_matchedTokens.size() == 1) { size_t const index = m_matchedTokens[0]; @@ -824,12 +824,12 @@ namespace impl switch (m_index) { case 0: // USA state - // USA states has 2-symbol synonims - return (isMatched || GetSynonimTokenLength(tokens, prefix) == 2); + // USA states has 2-symbol synonyms + return (isMatched || GetSynonymTokenLength(tokens, prefix) == 2); case 1: // country - // USA has synonims: "US" or "USA" - return (isMatched || (m_enName == "usa" && GetSynonimTokenLength(tokens, prefix) <= 3)); + // USA has synonyms: "US" or "USA" + return (isMatched || (m_enName == "usa" && GetSynonymTokenLength(tokens, prefix) <= 3)); case 2: // city // need full name match for cities @@ -901,7 +901,7 @@ void Query::SearchAddress() } else { - // Add founded locality as a result if nothing left to match. + // Add found locality as a result if nothing left to match. AddResultFromTrie(loc.m_value, mwmId); } } @@ -1121,7 +1121,8 @@ namespace impl Locality * p1st = 0; for (vector<Locality>::reverse_iterator i = arr.rbegin(); i != arr.rend(); ++i) { - if (!i->IsSuitable(m_query.m_tokens, m_query.m_prefix)) continue; + if (!i->IsSuitable(m_query.m_tokens, m_query.m_prefix)) + continue; if (!regions.empty()) { @@ -1139,7 +1140,8 @@ namespace impl if (p == 0) { // remember first suitable locality for the last chance - if (p1st == 0) p1st = &(*i); + if (p1st == 0) + p1st = &(*i); // locality doesn't belong to region - goto next continue; diff --git a/search/search_query.hpp b/search/search_query.hpp index dec68c3973..76ad0a1755 100644 --- a/search/search_query.hpp +++ b/search/search_query.hpp @@ -128,7 +128,6 @@ private: bool IsLangExist(int8_t l) const { return (m_langs.count(l) > 0); } private: - void AddSynonims(Query const & q, bool isLocalities); void FillLanguages(Query const & q); }; |