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

Method SetPreferredLocale

libs/search/processor.cpp:191–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void Processor::SetPreferredLocale(string const & locale)
192{
193 ASSERT(!locale.empty(), ());
194
195 LOG(LINFO, ("New preferred locale:", locale));
196
197 localisation::LanguageIndex const languageIndex = localisation::ConvertLanguageCodeToLanguageIndex(locale);
198 m_keywordsScorer.SetLanguages(LanguageTier::LANGUAGE_TIER_CURRENT, localisation::SimilarLanguageIndexes(languageIndex));
199
200 m_currentLanguageIndex = CategoriesHolder::MapLocaleToInteger(locale);
201
202 // Default initialization.
203 // If you want to reset input language, call SetInputLocale before search.
204 SetInputLocale(locale);
205 m_ranker.SetLocale(locale);
206}
207
208void Processor::SetInputLocale(string const & locale)
209{

Callers 2

EngineMethod · 0.80
SetLocaleMethod · 0.80

Calls 6

ASSERTFunction · 0.85
SimilarLanguageIndexesFunction · 0.85
emptyMethod · 0.45
SetLanguagesMethod · 0.45
SetLocaleMethod · 0.45

Tested by

no test coverage detected