{"action":"created","comment":{"url":"https://api.github.com/repos/google/personfinder/pulls/comments/40992204","id":40992204,"diff_hunk":"@@ -65,6 +69,46 @@ def romanize_japanese_name_by_name_dict(word):\n     return [word]\n \n \n+def romanize_japanese_name_by_name_dict(word, for_index=True):\n+    \"\"\"\n+    This method romanizes japanese name by using name dictionary.\n+    If word isn't found in dictionary, this method doesn't\n+    apply romanize.\n+    This method can return multiple romanizations.\n+    (because there are multiple ways to read the same kanji name in japanese)\n+    Args:\n+        for_index: this method is called for indexing or not\n+    Returns:\n+        [romanized_jp_name, and romanized_jp_name(split_word), ...]\n+    \"\"\"\n+    if not word:\n+        return ['']\n+\n+    words = []\n+    for index in xrange(1, len(word)):\n+        # split word because query word may not contains white space\n+        # e.g., if the query (e.g., \"山田\") doesn't contain white space,\n+        # it would work return words (\"yamata, yamada\")\n+        first_part = word[:index]\n+        last_part = word[index:]\n+        romanized_first_parts = romanize_single_japanese_word_by_name_dict(\n+            first_part)\n+        romanized_last_parts = romanize_single_japanese_word_by_name_dict(\n+            last_part)\n+        for romanized_first_part in romanized_first_parts:\n+            for romanized_last_part in romanized_last_parts:\n+                if romanized_first_part != first_part and \\\n+                        romanized_last_part != last_part:\n+                    words.append(romanized_first_part+romanized_last_part)\n+                    # To search by the query which doesn't contains white sapce,","path":"app/script_variant.py","position":66,"original_position":66,"commit_id":"752a07db136f43938f0d1fe78ea53a3a42883536","original_commit_id":"752a07db136f43938f0d1fe78ea53a3a42883536","user":{"login":"gimite","id":15363,"avatar_url":"https://avatars.githubusercontent.com/u/15363?v=3","gravatar_id":"","url":"https://api.github.com/users/gimite","html_url":"https://github.com/gimite","followers_url":"https://api.github.com/users/gimite/followers","following_url":"https://api.github.com/users/gimite/following{/other_user}","gists_url":"https://api.github.com/users/gimite/gists{/gist_id}","starred_url":"https://api.github.com/users/gimite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gimite/subscriptions","organizations_url":"https://api.github.com/users/gimite/orgs","repos_url":"https://api.github.com/users/gimite/repos","events_url":"https://api.github.com/users/gimite/events{/privacy}","received_events_url":"https://api.github.com/users/gimite/received_events","type":"User","site_admin":false},"body":"This comment looks wrong. If the query is a full name without white space e.g., \"やまだたろう\", we don't need these fields, right? You need to explain:\r\n\r\n- Why you need to add these fields in index\r\n- Why you must not add these fields for search queries\r\n\r\nIt may be easier to explain using an example.","created_at":"2015-10-02T05:18:17Z","updated_at":"2015-10-02T05:18:17Z","html_url":"https://github.com/google/personfinder/pull/186#discussion_r40992204","pull_request_url":"https://api.github.com/repos/google/personfinder/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/google/personfinder/pulls/comments/40992204"},"html":{"href":"https://github.com/google/personfinder/pull/186#discussion_r40992204"},"pull_request":{"href":"https://api.github.com/repos/google/personfinder/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/google/personfinder/pulls/186","id":46262129,"html_url":"https://github.com/google/personfinder/pull/186","diff_url":"https://github.com/google/personfinder/pull/186.diff","patch_url":"https://github.com/google/personfinder/pull/186.patch","issue_url":"https://api.github.com/repos/google/personfinder/issues/186","number":186,"state":"open","locked":false,"title":"Support romanizing \"山田太郎\" without space just by \"山田\" and \"太郎\" in the dictionary #179","user":{"login":"prazuma","id":7258066,"avatar_url":"https://avatars.githubusercontent.com/u/7258066?v=3","gravatar_id":"","url":"https://api.github.com/users/prazuma","html_url":"https://github.com/prazuma","followers_url":"https://api.github.com/users/prazuma/followers","following_url":"https://api.github.com/users/prazuma/following{/other_user}","gists_url":"https://api.github.com/users/prazuma/gists{/gist_id}","starred_url":"https://api.github.com/users/prazuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prazuma/subscriptions","organizations_url":"https://api.github.com/users/prazuma/orgs","repos_url":"https://api.github.com/users/prazuma/repos","events_url":"https://api.github.com/users/prazuma/events{/privacy}","received_events_url":"https://api.github.com/users/prazuma/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T10:51:50Z","updated_at":"2015-10-02T05:18:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02123a9d11595f12f131c447d45c005bf103487e","assignee":{"login":"gimite","id":15363,"avatar_url":"https://avatars.githubusercontent.com/u/15363?v=3","gravatar_id":"","url":"https://api.github.com/users/gimite","html_url":"https://github.com/gimite","followers_url":"https://api.github.com/users/gimite/followers","following_url":"https://api.github.com/users/gimite/following{/other_user}","gists_url":"https://api.github.com/users/gimite/gists{/gist_id}","starred_url":"https://api.github.com/users/gimite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gimite/subscriptions","organizations_url":"https://api.github.com/users/gimite/orgs","repos_url":"https://api.github.com/users/gimite/repos","events_url":"https://api.github.com/users/gimite/events{/privacy}","received_events_url":"https://api.github.com/users/gimite/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/google/personfinder/pulls/186/commits","review_comments_url":"https://api.github.com/repos/google/personfinder/pulls/186/comments","review_comment_url":"https://api.github.com/repos/google/personfinder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/personfinder/issues/186/comments","statuses_url":"https://api.github.com/repos/google/personfinder/statuses/752a07db136f43938f0d1fe78ea53a3a42883536","head":{"label":"google:mikahashimoto-support-yamadatarou","ref":"mikahashimoto-support-yamadatarou","sha":"752a07db136f43938f0d1fe78ea53a3a42883536","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":25369506,"name":"personfinder","full_name":"google/personfinder","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/personfinder","description":"Person Finder is a searchable missing person database written in Python and hosted on App Engine.","fork":false,"url":"https://api.github.com/repos/google/personfinder","forks_url":"https://api.github.com/repos/google/personfinder/forks","keys_url":"https://api.github.com/repos/google/personfinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/personfinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/personfinder/teams","hooks_url":"https://api.github.com/repos/google/personfinder/hooks","issue_events_url":"https://api.github.com/repos/google/personfinder/issues/events{/number}","events_url":"https://api.github.com/repos/google/personfinder/events","assignees_url":"https://api.github.com/repos/google/personfinder/assignees{/user}","branches_url":"https://api.github.com/repos/google/personfinder/branches{/branch}","tags_url":"https://api.github.com/repos/google/personfinder/tags","blobs_url":"https://api.github.com/repos/google/personfinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/personfinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/personfinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/personfinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/personfinder/statuses/{sha}","languages_url":"https://api.github.com/repos/google/personfinder/languages","stargazers_url":"https://api.github.com/repos/google/personfinder/stargazers","contributors_url":"https://api.github.com/repos/google/personfinder/contributors","subscribers_url":"https://api.github.com/repos/google/personfinder/subscribers","subscription_url":"https://api.github.com/repos/google/personfinder/subscription","commits_url":"https://api.github.com/repos/google/personfinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/personfinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/personfinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/personfinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/personfinder/contents/{+path}","compare_url":"https://api.github.com/repos/google/personfinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/personfinder/merges","archive_url":"https://api.github.com/repos/google/personfinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/personfinder/downloads","issues_url":"https://api.github.com/repos/google/personfinder/issues{/number}","pulls_url":"https://api.github.com/repos/google/personfinder/pulls{/number}","milestones_url":"https://api.github.com/repos/google/personfinder/milestones{/number}","notifications_url":"https://api.github.com/repos/google/personfinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/personfinder/labels{/name}","releases_url":"https://api.github.com/repos/google/personfinder/releases{/id}","created_at":"2014-10-17T17:36:25Z","updated_at":"2015-09-28T20:44:21Z","pushed_at":"2015-10-02T04:20:17Z","git_url":"git://github.com/google/personfinder.git","ssh_url":"git@github.com:google/personfinder.git","clone_url":"https://github.com/google/personfinder.git","svn_url":"https://github.com/google/personfinder","homepage":"https://google.org/personfinder","size":247461,"stargazers_count":112,"watchers_count":112,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":82,"forks":54,"open_issues":82,"watchers":112,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"ecf9af51f1ab52373741d23d05164e3f4334011f","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":25369506,"name":"personfinder","full_name":"google/personfinder","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/personfinder","description":"Person Finder is a searchable missing person database written in Python and hosted on App Engine.","fork":false,"url":"https://api.github.com/repos/google/personfinder","forks_url":"https://api.github.com/repos/google/personfinder/forks","keys_url":"https://api.github.com/repos/google/personfinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/personfinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/personfinder/teams","hooks_url":"https://api.github.com/repos/google/personfinder/hooks","issue_events_url":"https://api.github.com/repos/google/personfinder/issues/events{/number}","events_url":"https://api.github.com/repos/google/personfinder/events","assignees_url":"https://api.github.com/repos/google/personfinder/assignees{/user}","branches_url":"https://api.github.com/repos/google/personfinder/branches{/branch}","tags_url":"https://api.github.com/repos/google/personfinder/tags","blobs_url":"https://api.github.com/repos/google/personfinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/personfinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/personfinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/personfinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/personfinder/statuses/{sha}","languages_url":"https://api.github.com/repos/google/personfinder/languages","stargazers_url":"https://api.github.com/repos/google/personfinder/stargazers","contributors_url":"https://api.github.com/repos/google/personfinder/contributors","subscribers_url":"https://api.github.com/repos/google/personfinder/subscribers","subscription_url":"https://api.github.com/repos/google/personfinder/subscription","commits_url":"https://api.github.com/repos/google/personfinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/personfinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/personfinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/personfinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/personfinder/contents/{+path}","compare_url":"https://api.github.com/repos/google/personfinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/personfinder/merges","archive_url":"https://api.github.com/repos/google/personfinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/personfinder/downloads","issues_url":"https://api.github.com/repos/google/personfinder/issues{/number}","pulls_url":"https://api.github.com/repos/google/personfinder/pulls{/number}","milestones_url":"https://api.github.com/repos/google/personfinder/milestones{/number}","notifications_url":"https://api.github.com/repos/google/personfinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/personfinder/labels{/name}","releases_url":"https://api.github.com/repos/google/personfinder/releases{/id}","created_at":"2014-10-17T17:36:25Z","updated_at":"2015-09-28T20:44:21Z","pushed_at":"2015-10-02T04:20:17Z","git_url":"git://github.com/google/personfinder.git","ssh_url":"git@github.com:google/personfinder.git","clone_url":"https://github.com/google/personfinder.git","svn_url":"https://github.com/google/personfinder","homepage":"https://google.org/personfinder","size":247461,"stargazers_count":112,"watchers_count":112,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":82,"forks":54,"open_issues":82,"watchers":112,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/personfinder/pulls/186"},"html":{"href":"https://github.com/google/personfinder/pull/186"},"issue":{"href":"https://api.github.com/repos/google/personfinder/issues/186"},"comments":{"href":"https://api.github.com/repos/google/personfinder/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/google/personfinder/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/google/personfinder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/personfinder/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/google/personfinder/statuses/752a07db136f43938f0d1fe78ea53a3a42883536"}}}}