{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/55495899","id":55495899,"diff_hunk":"@@ -0,0 +1,185 @@\n+#include \"search/result.hpp\"\n+#include \"search/search_quality/sample.hpp\"\n+#include \"search/search_tests_support/test_search_engine.hpp\"\n+#include \"search/search_tests_support/test_search_request.hpp\"\n+#include \"search/v2/ranking_info.hpp\"\n+\n+#include \"indexer/classificator_loader.hpp\"\n+#include \"indexer/feature_algo.hpp\"\n+\n+#include \"platform/local_country_file.hpp\"\n+#include \"platform/local_country_file_utils.hpp\"\n+#include \"platform/platform.hpp\"\n+\n+#include \"base/string_utils.hpp\"\n+\n+#include \"std/fstream.hpp\"\n+#include \"std/iostream.hpp\"\n+#include \"std/limits.hpp\"\n+#include \"std/string.hpp\"\n+#include \"std/unique_ptr.hpp\"\n+#include \"std/vector.hpp\"\n+\n+#include \"3party/gflags/src/gflags/gflags.h\"\n+\n+using namespace search;\n+using namespace search::tests_support;\n+\n+DEFINE_string(data_path, \"\", \"Path to data directory (resources dir)\");\n+DEFINE_string(mwm_path, \"\", \"Path to mwm files (writable dir)\");\n+DEFINE_string(json_in, \"\", \"Path to the json file with samples (default: stdin)\");\n+\n+struct Context\n+{\n+  Context(Index & index) : m_index(index) {}\n+\n+  void GetFeature(FeatureID const & id, FeatureType & ft)\n+  {\n+    auto const & mwmId = id.m_mwmId;\n+    if (!m_guard || m_guard->GetId() != mwmId)\n+      m_guard = make_unique<Index::FeaturesLoaderGuard>(m_index, mwmId);\n+    m_guard->GetFeatureByIndex(id.m_index, ft);\n+  }\n+\n+  Index & m_index;\n+  unique_ptr<Index::FeaturesLoaderGuard> m_guard;\n+};\n+\n+void GetContents(istream & is, string & contents)\n+{\n+  string line;\n+  while (getline(is, line))\n+  {\n+    contents.append(line);\n+    contents.push_back('\\n');\n+  }\n+}\n+\n+bool Matches(Context & context, Sample::Result const & golden, search::Result const & actual)\n+{\n+  static double constexpr kEps = 2 * 1e-5;\n+  if (actual.GetResultType() != Result::RESULT_FEATURE)\n+    return false;\n+\n+  FeatureType ft;\n+  context.GetFeature(actual.GetFeatureID(), ft);\n+\n+  string name;\n+  if (!ft.GetName(FeatureType::DEFAULT_LANG, name))\n+    name.clear();\n+  auto const houseNumber = ft.GetHouseNumber();\n+  auto const center = feature::GetCenter(ft);\n+\n+  return golden.m_name == strings::MakeUniString(name) && golden.m_houseNumber == houseNumber &&\n+         my::AlmostEqualAbs(golden.m_pos, center, kEps);\n+}\n+\n+void SetRelevances(Context & context, vector<Sample::Result> const & golden,","path":"search/search_quality/features_collector_tool/features_collector_tool.cpp","position":77,"original_position":77,"commit_id":"b09954ae86912b40d1f4fc2972681baa4d1af507","original_commit_id":"b09954ae86912b40d1f4fc2972681baa4d1af507","user":{"login":"mpimenov","id":10366009,"avatar_url":"https://avatars.githubusercontent.com/u/10366009?v=3","gravatar_id":"","url":"https://api.github.com/users/mpimenov","html_url":"https://github.com/mpimenov","followers_url":"https://api.github.com/users/mpimenov/followers","following_url":"https://api.github.com/users/mpimenov/following{/other_user}","gists_url":"https://api.github.com/users/mpimenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpimenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpimenov/subscriptions","organizations_url":"https://api.github.com/users/mpimenov/orgs","repos_url":"https://api.github.com/users/mpimenov/repos","events_url":"https://api.github.com/users/mpimenov/events{/privacy}","received_events_url":"https://api.github.com/users/mpimenov/received_events","type":"User","site_admin":false},"body":"s/SetRelevances/SetRelevance/\r\nor\r\ns/Set/Relevances/SetRelevanceValues/","created_at":"2016-03-09T10:04:57Z","updated_at":"2016-03-09T10:04:57Z","html_url":"https://github.com/mapsme/omim/pull/2127#discussion_r55495899","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/2127","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/55495899"},"html":{"href":"https://github.com/mapsme/omim/pull/2127#discussion_r55495899"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2127"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/2127","id":61739225,"html_url":"https://github.com/mapsme/omim/pull/2127","diff_url":"https://github.com/mapsme/omim/pull/2127.diff","patch_url":"https://github.com/mapsme/omim/pull/2127.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/2127","number":2127,"state":"open","locked":false,"title":"[search] Added ranking info collecting tool.","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"@mpimenov PTAL","created_at":"2016-03-04T16:54:04Z","updated_at":"2016-03-09T10:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d48276dfd7e4e62904b0588b3184d3333df017b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/2127/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/2127/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/2127/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/b09954ae86912b40d1f4fc2972681baa4d1af507","head":{"label":"ygorshenin:ranking-info-collector-tool","ref":"ranking-info-collector-tool","sha":"b09954ae86912b40d1f4fc2972681baa4d1af507","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"repo":{"id":43427948,"name":"omim","full_name":"ygorshenin/omim","owner":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ygorshenin/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/ygorshenin/omim","forks_url":"https://api.github.com/repos/ygorshenin/omim/forks","keys_url":"https://api.github.com/repos/ygorshenin/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ygorshenin/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ygorshenin/omim/teams","hooks_url":"https://api.github.com/repos/ygorshenin/omim/hooks","issue_events_url":"https://api.github.com/repos/ygorshenin/omim/issues/events{/number}","events_url":"https://api.github.com/repos/ygorshenin/omim/events","assignees_url":"https://api.github.com/repos/ygorshenin/omim/assignees{/user}","branches_url":"https://api.github.com/repos/ygorshenin/omim/branches{/branch}","tags_url":"https://api.github.com/repos/ygorshenin/omim/tags","blobs_url":"https://api.github.com/repos/ygorshenin/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ygorshenin/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ygorshenin/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/ygorshenin/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ygorshenin/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/ygorshenin/omim/languages","stargazers_url":"https://api.github.com/repos/ygorshenin/omim/stargazers","contributors_url":"https://api.github.com/repos/ygorshenin/omim/contributors","subscribers_url":"https://api.github.com/repos/ygorshenin/omim/subscribers","subscription_url":"https://api.github.com/repos/ygorshenin/omim/subscription","commits_url":"https://api.github.com/repos/ygorshenin/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/ygorshenin/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/ygorshenin/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/ygorshenin/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/ygorshenin/omim/contents/{+path}","compare_url":"https://api.github.com/repos/ygorshenin/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ygorshenin/omim/merges","archive_url":"https://api.github.com/repos/ygorshenin/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ygorshenin/omim/downloads","issues_url":"https://api.github.com/repos/ygorshenin/omim/issues{/number}","pulls_url":"https://api.github.com/repos/ygorshenin/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/ygorshenin/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/ygorshenin/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ygorshenin/omim/labels{/name}","releases_url":"https://api.github.com/repos/ygorshenin/omim/releases{/id}","deployments_url":"https://api.github.com/repos/ygorshenin/omim/deployments","created_at":"2015-09-30T10:56:11Z","updated_at":"2015-09-30T10:58:25Z","pushed_at":"2016-03-09T08:31:06Z","git_url":"git://github.com/ygorshenin/omim.git","ssh_url":"git@github.com:ygorshenin/omim.git","clone_url":"https://github.com/ygorshenin/omim.git","svn_url":"https://github.com/ygorshenin/omim","homepage":null,"size":2207638,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:new-search","ref":"new-search","sha":"de3ae41eefffb23d1461d95b7e2e52b488467402","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-03-08T08:01:42Z","pushed_at":"2016-03-09T09:55:13Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2266171,"stargazers_count":1642,"watchers_count":1642,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":231,"mirror_url":null,"open_issues_count":120,"forks":231,"open_issues":120,"watchers":1642,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2127"},"html":{"href":"https://github.com/mapsme/omim/pull/2127"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/2127"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/2127/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2127/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2127/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/b09954ae86912b40d1f4fc2972681baa4d1af507"}}}}