{"action":"created","comment":{"url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/comments/197116411","pull_request_review_id":130795030,"id":197116411,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzExNjQxMQ==","diff_hunk":"@@ -163,23 +140,36 @@ def __init__(self, save_file_name: str):\n             self.knowledge_base: Dict[str, Dict[str, List[str]]] = dict()\n             json_manager.write(self.knowledge_base, save_file_name)\n \n-    def sentence_to_pattern(self, sentence: str) -> str:\n+    def _sentence_to_pattern(self, sentence: str) -> Optional[str]:\n         \"\"\"\n         Makes regex pattern out of sentence\n-        by getting all nouns and verbs and joining them into one string\n+        by getting all nouns, verbs and personal pronouns\n+        and joining them into one string\n         :param sentence: input sentence\n-        :return: regex string\n+        :return: regex string or None if it's impossible to make one\n         \"\"\"\n \n-        nouns_and_verbs = list()\n+        parts_of_speech = list()\n \n         tagged = pos_tag(word_tokenize(sentence), lang='rus')\n+\n+        # is sentence simple?\n+        if not self._is_simple(tagged):\n+            return None\n+\n         for word, tag in tagged:\n-            # S is for nouns and V is for verbs\n-            if tag in ['S', 'V']:\n-                nouns_and_verbs.append(text_processing.stem(word))\n+            if tag in [self._parts_of_speech['noun'], self._parts_of_speech['verb'],","path":"texting_ai.py","position":177,"original_position":177,"commit_id":"2a50d682397b2b9fdda4cd232b52d2a922ab86cc","original_commit_id":"9ed120b118495fcd52b52217d24c2abcee31a77d","user":{"login":"oninbo","id":8857825,"node_id":"MDQ6VXNlcjg4NTc4MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/8857825?v=4","gravatar_id":"","url":"https://api.github.com/users/oninbo","html_url":"https://github.com/oninbo","followers_url":"https://api.github.com/users/oninbo/followers","following_url":"https://api.github.com/users/oninbo/following{/other_user}","gists_url":"https://api.github.com/users/oninbo/gists{/gist_id}","starred_url":"https://api.github.com/users/oninbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oninbo/subscriptions","organizations_url":"https://api.github.com/users/oninbo/orgs","repos_url":"https://api.github.com/users/oninbo/repos","events_url":"https://api.github.com/users/oninbo/events{/privacy}","received_events_url":"https://api.github.com/users/oninbo/received_events","type":"User","site_admin":false},"body":"You mean putting `[self._parts_of_speech['noun'], self._parts_of_speech['verb']` inside a variable?","created_at":"2018-06-21T12:38:14Z","updated_at":"2018-06-21T12:38:14Z","html_url":"https://github.com/ReiBot/rei-bot-2/pull/22#discussion_r197116411","pull_request_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/comments/197116411"},"html":{"href":"https://github.com/ReiBot/rei-bot-2/pull/22#discussion_r197116411"},"pull_request":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22"}},"in_reply_to_id":197092866},"pull_request":{"url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22","id":195897736,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1ODk3NzM2","html_url":"https://github.com/ReiBot/rei-bot-2/pull/22","diff_url":"https://github.com/ReiBot/rei-bot-2/pull/22.diff","patch_url":"https://github.com/ReiBot/rei-bot-2/pull/22.patch","issue_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/22","number":22,"state":"open","locked":false,"title":"Learning","user":{"login":"oninbo","id":8857825,"node_id":"MDQ6VXNlcjg4NTc4MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/8857825?v=4","gravatar_id":"","url":"https://api.github.com/users/oninbo","html_url":"https://github.com/oninbo","followers_url":"https://api.github.com/users/oninbo/followers","following_url":"https://api.github.com/users/oninbo/following{/other_user}","gists_url":"https://api.github.com/users/oninbo/gists{/gist_id}","starred_url":"https://api.github.com/users/oninbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oninbo/subscriptions","organizations_url":"https://api.github.com/users/oninbo/orgs","repos_url":"https://api.github.com/users/oninbo/repos","events_url":"https://api.github.com/users/oninbo/events{/privacy}","received_events_url":"https://api.github.com/users/oninbo/received_events","type":"User","site_admin":false},"body":"So many things were done","created_at":"2018-06-19T17:09:02Z","updated_at":"2018-06-21T12:38:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff2b26858c5d1d798f78451564fa320251d3ebbb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22/commits","review_comments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22/comments","review_comment_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/22/comments","statuses_url":"https://api.github.com/repos/ReiBot/rei-bot-2/statuses/2a50d682397b2b9fdda4cd232b52d2a922ab86cc","head":{"label":"ReiBot:learning","ref":"learning","sha":"2a50d682397b2b9fdda4cd232b52d2a922ab86cc","user":{"login":"ReiBot","id":39763672,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzYzNjcy","avatar_url":"https://avatars3.githubusercontent.com/u/39763672?v=4","gravatar_id":"","url":"https://api.github.com/users/ReiBot","html_url":"https://github.com/ReiBot","followers_url":"https://api.github.com/users/ReiBot/followers","following_url":"https://api.github.com/users/ReiBot/following{/other_user}","gists_url":"https://api.github.com/users/ReiBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ReiBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReiBot/subscriptions","organizations_url":"https://api.github.com/users/ReiBot/orgs","repos_url":"https://api.github.com/users/ReiBot/repos","events_url":"https://api.github.com/users/ReiBot/events{/privacy}","received_events_url":"https://api.github.com/users/ReiBot/received_events","type":"Organization","site_admin":false},"repo":{"id":135346891,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUzNDY4OTE=","name":"rei-bot-2","full_name":"ReiBot/rei-bot-2","owner":{"login":"ReiBot","id":39763672,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzYzNjcy","avatar_url":"https://avatars3.githubusercontent.com/u/39763672?v=4","gravatar_id":"","url":"https://api.github.com/users/ReiBot","html_url":"https://github.com/ReiBot","followers_url":"https://api.github.com/users/ReiBot/followers","following_url":"https://api.github.com/users/ReiBot/following{/other_user}","gists_url":"https://api.github.com/users/ReiBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ReiBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReiBot/subscriptions","organizations_url":"https://api.github.com/users/ReiBot/orgs","repos_url":"https://api.github.com/users/ReiBot/repos","events_url":"https://api.github.com/users/ReiBot/events{/privacy}","received_events_url":"https://api.github.com/users/ReiBot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReiBot/rei-bot-2","description":"Chatbot for telegram groups representing anime character Ayanami Rei","fork":false,"url":"https://api.github.com/repos/ReiBot/rei-bot-2","forks_url":"https://api.github.com/repos/ReiBot/rei-bot-2/forks","keys_url":"https://api.github.com/repos/ReiBot/rei-bot-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReiBot/rei-bot-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReiBot/rei-bot-2/teams","hooks_url":"https://api.github.com/repos/ReiBot/rei-bot-2/hooks","issue_events_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/events{/number}","events_url":"https://api.github.com/repos/ReiBot/rei-bot-2/events","assignees_url":"https://api.github.com/repos/ReiBot/rei-bot-2/assignees{/user}","branches_url":"https://api.github.com/repos/ReiBot/rei-bot-2/branches{/branch}","tags_url":"https://api.github.com/repos/ReiBot/rei-bot-2/tags","blobs_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReiBot/rei-bot-2/statuses/{sha}","languages_url":"https://api.github.com/repos/ReiBot/rei-bot-2/languages","stargazers_url":"https://api.github.com/repos/ReiBot/rei-bot-2/stargazers","contributors_url":"https://api.github.com/repos/ReiBot/rei-bot-2/contributors","subscribers_url":"https://api.github.com/repos/ReiBot/rei-bot-2/subscribers","subscription_url":"https://api.github.com/repos/ReiBot/rei-bot-2/subscription","commits_url":"https://api.github.com/repos/ReiBot/rei-bot-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReiBot/rei-bot-2/contents/{+path}","compare_url":"https://api.github.com/repos/ReiBot/rei-bot-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReiBot/rei-bot-2/merges","archive_url":"https://api.github.com/repos/ReiBot/rei-bot-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReiBot/rei-bot-2/downloads","issues_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues{/number}","pulls_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls{/number}","milestones_url":"https://api.github.com/repos/ReiBot/rei-bot-2/milestones{/number}","notifications_url":"https://api.github.com/repos/ReiBot/rei-bot-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReiBot/rei-bot-2/labels{/name}","releases_url":"https://api.github.com/repos/ReiBot/rei-bot-2/releases{/id}","deployments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/deployments","created_at":"2018-05-29T20:02:10Z","updated_at":"2018-06-17T17:24:20Z","pushed_at":"2018-06-21T11:35:25Z","git_url":"git://github.com/ReiBot/rei-bot-2.git","ssh_url":"git@github.com:ReiBot/rei-bot-2.git","clone_url":"https://github.com/ReiBot/rei-bot-2.git","svn_url":"https://github.com/ReiBot/rei-bot-2","homepage":null,"size":268,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ReiBot:dev","ref":"dev","sha":"96f30f0321b68d21522fff637caf49095988167c","user":{"login":"ReiBot","id":39763672,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzYzNjcy","avatar_url":"https://avatars3.githubusercontent.com/u/39763672?v=4","gravatar_id":"","url":"https://api.github.com/users/ReiBot","html_url":"https://github.com/ReiBot","followers_url":"https://api.github.com/users/ReiBot/followers","following_url":"https://api.github.com/users/ReiBot/following{/other_user}","gists_url":"https://api.github.com/users/ReiBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ReiBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReiBot/subscriptions","organizations_url":"https://api.github.com/users/ReiBot/orgs","repos_url":"https://api.github.com/users/ReiBot/repos","events_url":"https://api.github.com/users/ReiBot/events{/privacy}","received_events_url":"https://api.github.com/users/ReiBot/received_events","type":"Organization","site_admin":false},"repo":{"id":135346891,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUzNDY4OTE=","name":"rei-bot-2","full_name":"ReiBot/rei-bot-2","owner":{"login":"ReiBot","id":39763672,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzYzNjcy","avatar_url":"https://avatars3.githubusercontent.com/u/39763672?v=4","gravatar_id":"","url":"https://api.github.com/users/ReiBot","html_url":"https://github.com/ReiBot","followers_url":"https://api.github.com/users/ReiBot/followers","following_url":"https://api.github.com/users/ReiBot/following{/other_user}","gists_url":"https://api.github.com/users/ReiBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ReiBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReiBot/subscriptions","organizations_url":"https://api.github.com/users/ReiBot/orgs","repos_url":"https://api.github.com/users/ReiBot/repos","events_url":"https://api.github.com/users/ReiBot/events{/privacy}","received_events_url":"https://api.github.com/users/ReiBot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReiBot/rei-bot-2","description":"Chatbot for telegram groups representing anime character Ayanami Rei","fork":false,"url":"https://api.github.com/repos/ReiBot/rei-bot-2","forks_url":"https://api.github.com/repos/ReiBot/rei-bot-2/forks","keys_url":"https://api.github.com/repos/ReiBot/rei-bot-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReiBot/rei-bot-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReiBot/rei-bot-2/teams","hooks_url":"https://api.github.com/repos/ReiBot/rei-bot-2/hooks","issue_events_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/events{/number}","events_url":"https://api.github.com/repos/ReiBot/rei-bot-2/events","assignees_url":"https://api.github.com/repos/ReiBot/rei-bot-2/assignees{/user}","branches_url":"https://api.github.com/repos/ReiBot/rei-bot-2/branches{/branch}","tags_url":"https://api.github.com/repos/ReiBot/rei-bot-2/tags","blobs_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReiBot/rei-bot-2/statuses/{sha}","languages_url":"https://api.github.com/repos/ReiBot/rei-bot-2/languages","stargazers_url":"https://api.github.com/repos/ReiBot/rei-bot-2/stargazers","contributors_url":"https://api.github.com/repos/ReiBot/rei-bot-2/contributors","subscribers_url":"https://api.github.com/repos/ReiBot/rei-bot-2/subscribers","subscription_url":"https://api.github.com/repos/ReiBot/rei-bot-2/subscription","commits_url":"https://api.github.com/repos/ReiBot/rei-bot-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReiBot/rei-bot-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReiBot/rei-bot-2/contents/{+path}","compare_url":"https://api.github.com/repos/ReiBot/rei-bot-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReiBot/rei-bot-2/merges","archive_url":"https://api.github.com/repos/ReiBot/rei-bot-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReiBot/rei-bot-2/downloads","issues_url":"https://api.github.com/repos/ReiBot/rei-bot-2/issues{/number}","pulls_url":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls{/number}","milestones_url":"https://api.github.com/repos/ReiBot/rei-bot-2/milestones{/number}","notifications_url":"https://api.github.com/repos/ReiBot/rei-bot-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReiBot/rei-bot-2/labels{/name}","releases_url":"https://api.github.com/repos/ReiBot/rei-bot-2/releases{/id}","deployments_url":"https://api.github.com/repos/ReiBot/rei-bot-2/deployments","created_at":"2018-05-29T20:02:10Z","updated_at":"2018-06-17T17:24:20Z","pushed_at":"2018-06-21T11:35:25Z","git_url":"git://github.com/ReiBot/rei-bot-2.git","ssh_url":"git@github.com:ReiBot/rei-bot-2.git","clone_url":"https://github.com/ReiBot/rei-bot-2.git","svn_url":"https://github.com/ReiBot/rei-bot-2","homepage":null,"size":268,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22"},"html":{"href":"https://github.com/ReiBot/rei-bot-2/pull/22"},"issue":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/22"},"comments":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/ReiBot/rei-bot-2/statuses/2a50d682397b2b9fdda4cd232b52d2a922ab86cc"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"oninbo"}}