{"action":"created","comment":{"url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/comments/42784540","id":42784540,"diff_hunk":"@@ -25,13 +26,15 @@ class Card < ActiveRecord::Base\n   scope :for_review, -> { where(\"review_date < ?\", Time.now) }\n \n   def check_translation(translation)\n-    if translated_text == clear(translation)\n+    l_distance = Text::Levenshtein.distance(translated_text, clear(translation) )\n+    if l_distance < LEVENSHTEIN_DISTANCE_MAXIMUM\n       increase_review_level\n-      return true\n+      translated = true\n     else\n       decrease_review_level\n-      return false\n+      translated = false\n     end\n+    return {translated: translated, levenshtein_distance: l_distance}","path":"app/models/card.rb","position":23,"original_position":23,"commit_id":"1092dea887cb7e099c0d12d06016004dbaec9953","original_commit_id":"1092dea887cb7e099c0d12d06016004dbaec9953","user":{"login":"mkdev-mentor-1","id":11962702,"avatar_url":"https://avatars.githubusercontent.com/u/11962702?v=3","gravatar_id":"","url":"https://api.github.com/users/mkdev-mentor-1","html_url":"https://github.com/mkdev-mentor-1","followers_url":"https://api.github.com/users/mkdev-mentor-1/followers","following_url":"https://api.github.com/users/mkdev-mentor-1/following{/other_user}","gists_url":"https://api.github.com/users/mkdev-mentor-1/gists{/gist_id}","starred_url":"https://api.github.com/users/mkdev-mentor-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkdev-mentor-1/subscriptions","organizations_url":"https://api.github.com/users/mkdev-mentor-1/orgs","repos_url":"https://api.github.com/users/mkdev-mentor-1/repos","events_url":"https://api.github.com/users/mkdev-mentor-1/events{/privacy}","received_events_url":"https://api.github.com/users/mkdev-mentor-1/received_events","type":"User","site_admin":false},"body":"\"переведено\" то всегла, а вот корректно ли)","created_at":"2015-10-22T18:14:02Z","updated_at":"2015-10-22T18:14:02Z","html_url":"https://github.com/MistaTwista/flashcards/pull/16#discussion_r42784540","pull_request_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/comments/42784540"},"html":{"href":"https://github.com/MistaTwista/flashcards/pull/16#discussion_r42784540"},"pull_request":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16","id":48492296,"html_url":"https://github.com/MistaTwista/flashcards/pull/16","diff_url":"https://github.com/MistaTwista/flashcards/pull/16.diff","patch_url":"https://github.com/MistaTwista/flashcards/pull/16.patch","issue_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/16","number":16,"state":"open","locked":false,"title":"Levenshtein check of user translation implemented","user":{"login":"MistaTwista","id":2895309,"avatar_url":"https://avatars.githubusercontent.com/u/2895309?v=3","gravatar_id":"","url":"https://api.github.com/users/MistaTwista","html_url":"https://github.com/MistaTwista","followers_url":"https://api.github.com/users/MistaTwista/followers","following_url":"https://api.github.com/users/MistaTwista/following{/other_user}","gists_url":"https://api.github.com/users/MistaTwista/gists{/gist_id}","starred_url":"https://api.github.com/users/MistaTwista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MistaTwista/subscriptions","organizations_url":"https://api.github.com/users/MistaTwista/orgs","repos_url":"https://api.github.com/users/MistaTwista/repos","events_url":"https://api.github.com/users/MistaTwista/events{/privacy}","received_events_url":"https://api.github.com/users/MistaTwista/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-22T18:11:15Z","updated_at":"2015-10-22T18:14:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8aa144c049e48a0c8596b538db73bbeeff4d5a7e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16/commits","review_comments_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16/comments","review_comment_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/16/comments","statuses_url":"https://api.github.com/repos/MistaTwista/flashcards/statuses/1092dea887cb7e099c0d12d06016004dbaec9953","head":{"label":"MistaTwista:14-levenshtein","ref":"14-levenshtein","sha":"1092dea887cb7e099c0d12d06016004dbaec9953","user":{"login":"MistaTwista","id":2895309,"avatar_url":"https://avatars.githubusercontent.com/u/2895309?v=3","gravatar_id":"","url":"https://api.github.com/users/MistaTwista","html_url":"https://github.com/MistaTwista","followers_url":"https://api.github.com/users/MistaTwista/followers","following_url":"https://api.github.com/users/MistaTwista/following{/other_user}","gists_url":"https://api.github.com/users/MistaTwista/gists{/gist_id}","starred_url":"https://api.github.com/users/MistaTwista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MistaTwista/subscriptions","organizations_url":"https://api.github.com/users/MistaTwista/orgs","repos_url":"https://api.github.com/users/MistaTwista/repos","events_url":"https://api.github.com/users/MistaTwista/events{/privacy}","received_events_url":"https://api.github.com/users/MistaTwista/received_events","type":"User","site_admin":false},"repo":{"id":40986514,"name":"flashcards","full_name":"MistaTwista/flashcards","owner":{"login":"MistaTwista","id":2895309,"avatar_url":"https://avatars.githubusercontent.com/u/2895309?v=3","gravatar_id":"","url":"https://api.github.com/users/MistaTwista","html_url":"https://github.com/MistaTwista","followers_url":"https://api.github.com/users/MistaTwista/followers","following_url":"https://api.github.com/users/MistaTwista/following{/other_user}","gists_url":"https://api.github.com/users/MistaTwista/gists{/gist_id}","starred_url":"https://api.github.com/users/MistaTwista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MistaTwista/subscriptions","organizations_url":"https://api.github.com/users/MistaTwista/orgs","repos_url":"https://api.github.com/users/MistaTwista/repos","events_url":"https://api.github.com/users/MistaTwista/events{/privacy}","received_events_url":"https://api.github.com/users/MistaTwista/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MistaTwista/flashcards","description":"Flash cards apppication","fork":false,"url":"https://api.github.com/repos/MistaTwista/flashcards","forks_url":"https://api.github.com/repos/MistaTwista/flashcards/forks","keys_url":"https://api.github.com/repos/MistaTwista/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MistaTwista/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MistaTwista/flashcards/teams","hooks_url":"https://api.github.com/repos/MistaTwista/flashcards/hooks","issue_events_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/MistaTwista/flashcards/events","assignees_url":"https://api.github.com/repos/MistaTwista/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/MistaTwista/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/MistaTwista/flashcards/tags","blobs_url":"https://api.github.com/repos/MistaTwista/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MistaTwista/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MistaTwista/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/MistaTwista/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MistaTwista/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/MistaTwista/flashcards/languages","stargazers_url":"https://api.github.com/repos/MistaTwista/flashcards/stargazers","contributors_url":"https://api.github.com/repos/MistaTwista/flashcards/contributors","subscribers_url":"https://api.github.com/repos/MistaTwista/flashcards/subscribers","subscription_url":"https://api.github.com/repos/MistaTwista/flashcards/subscription","commits_url":"https://api.github.com/repos/MistaTwista/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/MistaTwista/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/MistaTwista/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/MistaTwista/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/MistaTwista/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MistaTwista/flashcards/merges","archive_url":"https://api.github.com/repos/MistaTwista/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MistaTwista/flashcards/downloads","issues_url":"https://api.github.com/repos/MistaTwista/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/MistaTwista/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/MistaTwista/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MistaTwista/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/MistaTwista/flashcards/releases{/id}","created_at":"2015-08-18T17:22:12Z","updated_at":"2015-08-18T18:23:45Z","pushed_at":"2015-10-22T18:11:15Z","git_url":"git://github.com/MistaTwista/flashcards.git","ssh_url":"git@github.com:MistaTwista/flashcards.git","clone_url":"https://github.com/MistaTwista/flashcards.git","svn_url":"https://github.com/MistaTwista/flashcards","homepage":null,"size":748,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"MistaTwista:master","ref":"master","sha":"acf53e481ce21f38a7a5b537538a063da888f758","user":{"login":"MistaTwista","id":2895309,"avatar_url":"https://avatars.githubusercontent.com/u/2895309?v=3","gravatar_id":"","url":"https://api.github.com/users/MistaTwista","html_url":"https://github.com/MistaTwista","followers_url":"https://api.github.com/users/MistaTwista/followers","following_url":"https://api.github.com/users/MistaTwista/following{/other_user}","gists_url":"https://api.github.com/users/MistaTwista/gists{/gist_id}","starred_url":"https://api.github.com/users/MistaTwista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MistaTwista/subscriptions","organizations_url":"https://api.github.com/users/MistaTwista/orgs","repos_url":"https://api.github.com/users/MistaTwista/repos","events_url":"https://api.github.com/users/MistaTwista/events{/privacy}","received_events_url":"https://api.github.com/users/MistaTwista/received_events","type":"User","site_admin":false},"repo":{"id":40986514,"name":"flashcards","full_name":"MistaTwista/flashcards","owner":{"login":"MistaTwista","id":2895309,"avatar_url":"https://avatars.githubusercontent.com/u/2895309?v=3","gravatar_id":"","url":"https://api.github.com/users/MistaTwista","html_url":"https://github.com/MistaTwista","followers_url":"https://api.github.com/users/MistaTwista/followers","following_url":"https://api.github.com/users/MistaTwista/following{/other_user}","gists_url":"https://api.github.com/users/MistaTwista/gists{/gist_id}","starred_url":"https://api.github.com/users/MistaTwista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MistaTwista/subscriptions","organizations_url":"https://api.github.com/users/MistaTwista/orgs","repos_url":"https://api.github.com/users/MistaTwista/repos","events_url":"https://api.github.com/users/MistaTwista/events{/privacy}","received_events_url":"https://api.github.com/users/MistaTwista/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MistaTwista/flashcards","description":"Flash cards apppication","fork":false,"url":"https://api.github.com/repos/MistaTwista/flashcards","forks_url":"https://api.github.com/repos/MistaTwista/flashcards/forks","keys_url":"https://api.github.com/repos/MistaTwista/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MistaTwista/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MistaTwista/flashcards/teams","hooks_url":"https://api.github.com/repos/MistaTwista/flashcards/hooks","issue_events_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/MistaTwista/flashcards/events","assignees_url":"https://api.github.com/repos/MistaTwista/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/MistaTwista/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/MistaTwista/flashcards/tags","blobs_url":"https://api.github.com/repos/MistaTwista/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MistaTwista/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MistaTwista/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/MistaTwista/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MistaTwista/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/MistaTwista/flashcards/languages","stargazers_url":"https://api.github.com/repos/MistaTwista/flashcards/stargazers","contributors_url":"https://api.github.com/repos/MistaTwista/flashcards/contributors","subscribers_url":"https://api.github.com/repos/MistaTwista/flashcards/subscribers","subscription_url":"https://api.github.com/repos/MistaTwista/flashcards/subscription","commits_url":"https://api.github.com/repos/MistaTwista/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/MistaTwista/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/MistaTwista/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/MistaTwista/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/MistaTwista/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/MistaTwista/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MistaTwista/flashcards/merges","archive_url":"https://api.github.com/repos/MistaTwista/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MistaTwista/flashcards/downloads","issues_url":"https://api.github.com/repos/MistaTwista/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/MistaTwista/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/MistaTwista/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/MistaTwista/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MistaTwista/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/MistaTwista/flashcards/releases{/id}","created_at":"2015-08-18T17:22:12Z","updated_at":"2015-08-18T18:23:45Z","pushed_at":"2015-10-22T18:11:15Z","git_url":"git://github.com/MistaTwista/flashcards.git","ssh_url":"git@github.com:MistaTwista/flashcards.git","clone_url":"https://github.com/MistaTwista/flashcards.git","svn_url":"https://github.com/MistaTwista/flashcards","homepage":null,"size":748,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16"},"html":{"href":"https://github.com/MistaTwista/flashcards/pull/16"},"issue":{"href":"https://api.github.com/repos/MistaTwista/flashcards/issues/16"},"comments":{"href":"https://api.github.com/repos/MistaTwista/flashcards/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MistaTwista/flashcards/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/MistaTwista/flashcards/statuses/1092dea887cb7e099c0d12d06016004dbaec9953"}}}}