From b739e306b85e285c7474573f1f4a4232d4239ff7 Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Mon, 12 Nov 2018 12:07:18 +0300 Subject: [PATCH] [index] Make IsEatChecker consistent with new eat category. --- generator/emitter_restaurants.cpp | 2 +- generator/opentable_dataset.cpp | 2 +- indexer/ftypes_matcher.cpp | 6 ++++-- indexer/ftypes_matcher.hpp | 6 +++--- search/categories_cache.cpp | 2 +- search/processor.cpp | 2 +- ugc/ugc_tests/storage_tests.cpp | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/generator/emitter_restaurants.cpp b/generator/emitter_restaurants.cpp index 14124815e2..6512e34ae6 100644 --- a/generator/emitter_restaurants.cpp +++ b/generator/emitter_restaurants.cpp @@ -12,7 +12,7 @@ EmitterRestaurants::EmitterRestaurants(std::vector & features) void EmitterRestaurants::operator()(FeatureBuilder1 & fb) { - if (!ftypes::IsFoodChecker::Instance()(fb.GetParams().m_types) || fb.GetParams().name.IsEmpty()) + if (!ftypes::IsEatChecker::Instance()(fb.GetParams().m_types) || fb.GetParams().name.IsEmpty()) { ++m_stats.m_unexpectedFeatures; return; diff --git a/generator/opentable_dataset.cpp b/generator/opentable_dataset.cpp index 1b2e7fc09d..d53f879adb 100644 --- a/generator/opentable_dataset.cpp +++ b/generator/opentable_dataset.cpp @@ -40,7 +40,7 @@ bool OpentableDataset::NecessaryMatchingConditionHolds(FeatureBuilder1 const & f if (fb.GetName(StringUtf8Multilang::kDefaultCode).empty()) return false; - return ftypes::IsFoodChecker::Instance()(fb.GetTypes()); + return ftypes::IsEatChecker::Instance()(fb.GetTypes()); } template <> diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index aa7c19e15b..4a82b7eb86 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -379,15 +379,17 @@ IsWifiChecker::IsWifiChecker() m_types.push_back(classif().GetTypeByPath({"internet_access", "wlan"})); } -IsFoodChecker:: IsFoodChecker() +IsEatChecker:: IsEatChecker() { Classificator const & c = classif(); char const * const paths[][2] = { {"amenity", "cafe"}, {"amenity", "bar"}, + {"amenity", "biergarden"}, {"amenity", "pub"}, {"amenity", "fast_food"}, - {"amenity", "restaurant"} + {"amenity", "restaurant"}, + {"shop", "bakery"} }; for (auto const & path : paths) m_types.push_back(c.GetTypeByPath({path[0], path[1]})); diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp index bb591955bf..745abb9072 100644 --- a/indexer/ftypes_matcher.hpp +++ b/indexer/ftypes_matcher.hpp @@ -214,11 +214,11 @@ public: DECLARE_CHECKER_INSTANCE(IsWifiChecker); }; -class IsFoodChecker : public BaseChecker +class IsEatChecker : public BaseChecker { - IsFoodChecker(); + IsEatChecker(); public: - DECLARE_CHECKER_INSTANCE(IsFoodChecker); + DECLARE_CHECKER_INSTANCE(IsEatChecker); std::vector const & GetTypes() const { return m_types; } }; diff --git a/search/categories_cache.cpp b/search/categories_cache.cpp index df090e1d68..a9356e8e21 100644 --- a/search/categories_cache.cpp +++ b/search/categories_cache.cpp @@ -70,7 +70,7 @@ HotelsCache::HotelsCache(base::Cancellable const & cancellable) // FoodCache --------------------------------------------------------------------------------------- FoodCache::FoodCache(base::Cancellable const & cancellable) - : CategoriesCache(ftypes::IsFoodChecker::Instance(), cancellable) + : CategoriesCache(ftypes::IsEatChecker::Instance(), cancellable) { } } // namespace search diff --git a/search/processor.cpp b/search/processor.cpp index 3ceb0e7676..6604a05566 100644 --- a/search/processor.cpp +++ b/search/processor.cpp @@ -288,7 +288,7 @@ void Processor::SetQuery(string const & query) if (isCuisineRequest) { m_isCategorialRequest = true; - m_preferredTypes = ftypes::IsFoodChecker::Instance().GetTypes(); + m_preferredTypes = ftypes::IsEatChecker::Instance().GetTypes(); } } diff --git a/ugc/ugc_tests/storage_tests.cpp b/ugc/ugc_tests/storage_tests.cpp index 909700a472..9a1e20e500 100644 --- a/ugc/ugc_tests/storage_tests.cpp +++ b/ugc/ugc_tests/storage_tests.cpp @@ -126,7 +126,7 @@ public: FeatureID FeatureIdForCafeAtPoint(m2::PointD const & mercator) { - return FeatureIdForPoint(mercator, ftypes::IsFoodChecker::Instance()); + return FeatureIdForPoint(mercator, ftypes::IsEatChecker::Instance()); } FeatureID FeatureIdForRailwayAtPoint(m2::PointD const & mercator)