{"action":"created","comment":{"url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/comments/58350254","id":58350254,"diff_hunk":"@@ -243,39 +259,26 @@ def align_tags_wrd(s_tokens, s_tags, t_tokens, align):\n     # open tag anc close tags are tuples (word_position, tag)\n     s_wrd_tags = _tags_to_wrd_position_tuples(s_tokens, s_tags)\n     for tpl in s_wrd_tags:\n-        (s_p1, i1), (s_p2, i2) = tpl\n-        c1 = (i1['tag_type'] == 'single' and s_p2 is None and i2 is None)\n-        c2 = c1 or (i1['tag_type'] == 'open' and i2['tag_type'] == 'close')\n-        assert c2\n         t_min = len(t_tokens)\n         t_max = -1\n-        if c1:\n-            s_positions = [s_p1]\n-        else:\n-            s_positions = range(s_p1, s_p2 + 1)  ## including src_pos2\n-\n-        for s_pos in s_positions:\n-            align_pos = [tp for sp, tp in align if sp == s_pos]\n-            t_max = max([t_max] + align_pos)\n-            t_min = min([t_min] + align_pos)\n-        if c1:\n-            t_wrd_tags.append(((t_min, i1), (None, None)))\n-        else:\n-            t_wrd_tags.append(((t_min, i1), (t_max, i2)))\n+        s_positions = s_wrd_tags[tpl][0]\n+        i1 = s_wrd_tags[tpl][1]\n+        align_pos = [tp for sp, tp in align if sp == s_positions]\n+        t_max = max([t_max] + align_pos)\n+        t_min = min([t_min] + align_pos)\n+        t_wrd_tags.append(((t_min, i1), (None, None)))","path":"unbabel_text_utils/tags_align/align_wa/wa_tag_align.py","position":150,"original_position":150,"commit_id":"f709c4d73ba399638e443278fbf7b38f334d4ec2","original_commit_id":"f709c4d73ba399638e443278fbf7b38f334d4ec2","user":{"login":"vascop","id":537021,"avatar_url":"https://avatars.githubusercontent.com/u/537021?v=3","gravatar_id":"","url":"https://api.github.com/users/vascop","html_url":"https://github.com/vascop","followers_url":"https://api.github.com/users/vascop/followers","following_url":"https://api.github.com/users/vascop/following{/other_user}","gists_url":"https://api.github.com/users/vascop/gists{/gist_id}","starred_url":"https://api.github.com/users/vascop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vascop/subscriptions","organizations_url":"https://api.github.com/users/vascop/orgs","repos_url":"https://api.github.com/users/vascop/repos","events_url":"https://api.github.com/users/vascop/events{/privacy}","received_events_url":"https://api.github.com/users/vascop/received_events","type":"User","site_admin":false},"body":"There's no need to keep appending `(None, None)`, and then accessing `tpl[0]` in `_wrd_position_tuples_to_tags`. This was the case when we were testing but there's no need to keep doing it.","created_at":"2016-04-04T09:37:23Z","updated_at":"2016-04-04T09:37:23Z","html_url":"https://github.com/Unbabel/unbabel-text-utils/pull/10#discussion_r58350254","pull_request_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/comments/58350254"},"html":{"href":"https://github.com/Unbabel/unbabel-text-utils/pull/10#discussion_r58350254"},"pull_request":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10","id":63701509,"html_url":"https://github.com/Unbabel/unbabel-text-utils/pull/10","diff_url":"https://github.com/Unbabel/unbabel-text-utils/pull/10.diff","patch_url":"https://github.com/Unbabel/unbabel-text-utils/pull/10.patch","issue_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/10","number":10,"state":"open","locked":false,"title":"Bugfix align tags clean commits","user":{"login":"mariagardbraga","id":16537895,"avatar_url":"https://avatars.githubusercontent.com/u/16537895?v=3","gravatar_id":"","url":"https://api.github.com/users/mariagardbraga","html_url":"https://github.com/mariagardbraga","followers_url":"https://api.github.com/users/mariagardbraga/followers","following_url":"https://api.github.com/users/mariagardbraga/following{/other_user}","gists_url":"https://api.github.com/users/mariagardbraga/gists{/gist_id}","starred_url":"https://api.github.com/users/mariagardbraga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariagardbraga/subscriptions","organizations_url":"https://api.github.com/users/mariagardbraga/orgs","repos_url":"https://api.github.com/users/mariagardbraga/repos","events_url":"https://api.github.com/users/mariagardbraga/events{/privacy}","received_events_url":"https://api.github.com/users/mariagardbraga/received_events","type":"User","site_admin":false},"body":"changes in wa_tag_align.py file. Each tag is handled isolated and there are no attempts to pair them with other tag. Currently not crashing for single and unbalanced tags.","created_at":"2016-03-22T10:58:50Z","updated_at":"2016-04-04T09:37:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7703aa49f40500acd65aee814025391e926bba25","assignee":{"login":"vascop","id":537021,"avatar_url":"https://avatars.githubusercontent.com/u/537021?v=3","gravatar_id":"","url":"https://api.github.com/users/vascop","html_url":"https://github.com/vascop","followers_url":"https://api.github.com/users/vascop/followers","following_url":"https://api.github.com/users/vascop/following{/other_user}","gists_url":"https://api.github.com/users/vascop/gists{/gist_id}","starred_url":"https://api.github.com/users/vascop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vascop/subscriptions","organizations_url":"https://api.github.com/users/vascop/orgs","repos_url":"https://api.github.com/users/vascop/repos","events_url":"https://api.github.com/users/vascop/events{/privacy}","received_events_url":"https://api.github.com/users/vascop/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10/commits","review_comments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10/comments","review_comment_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/10/comments","statuses_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/statuses/f709c4d73ba399638e443278fbf7b38f334d4ec2","head":{"label":"Unbabel:bugfix_align_tags_clean_commits","ref":"bugfix_align_tags_clean_commits","sha":"f709c4d73ba399638e443278fbf7b38f334d4ec2","user":{"login":"Unbabel","id":6173964,"avatar_url":"https://avatars.githubusercontent.com/u/6173964?v=3","gravatar_id":"","url":"https://api.github.com/users/Unbabel","html_url":"https://github.com/Unbabel","followers_url":"https://api.github.com/users/Unbabel/followers","following_url":"https://api.github.com/users/Unbabel/following{/other_user}","gists_url":"https://api.github.com/users/Unbabel/gists{/gist_id}","starred_url":"https://api.github.com/users/Unbabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unbabel/subscriptions","organizations_url":"https://api.github.com/users/Unbabel/orgs","repos_url":"https://api.github.com/users/Unbabel/repos","events_url":"https://api.github.com/users/Unbabel/events{/privacy}","received_events_url":"https://api.github.com/users/Unbabel/received_events","type":"Organization","site_admin":false},"repo":{"id":45260496,"name":"unbabel-text-utils","full_name":"Unbabel/unbabel-text-utils","owner":{"login":"Unbabel","id":6173964,"avatar_url":"https://avatars.githubusercontent.com/u/6173964?v=3","gravatar_id":"","url":"https://api.github.com/users/Unbabel","html_url":"https://github.com/Unbabel","followers_url":"https://api.github.com/users/Unbabel/followers","following_url":"https://api.github.com/users/Unbabel/following{/other_user}","gists_url":"https://api.github.com/users/Unbabel/gists{/gist_id}","starred_url":"https://api.github.com/users/Unbabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unbabel/subscriptions","organizations_url":"https://api.github.com/users/Unbabel/orgs","repos_url":"https://api.github.com/users/Unbabel/repos","events_url":"https://api.github.com/users/Unbabel/events{/privacy}","received_events_url":"https://api.github.com/users/Unbabel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unbabel/unbabel-text-utils","description":"Basic Text Utilities for Unbabel.","fork":false,"url":"https://api.github.com/repos/Unbabel/unbabel-text-utils","forks_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/forks","keys_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/teams","hooks_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/hooks","issue_events_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/events{/number}","events_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/events","assignees_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/assignees{/user}","branches_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/branches{/branch}","tags_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/tags","blobs_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/languages","stargazers_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/stargazers","contributors_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/contributors","subscribers_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/subscribers","subscription_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/subscription","commits_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/contents/{+path}","compare_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/merges","archive_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/downloads","issues_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues{/number}","pulls_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/labels{/name}","releases_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/releases{/id}","deployments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/deployments","created_at":"2015-10-30T15:46:48Z","updated_at":"2016-01-15T17:39:29Z","pushed_at":"2016-04-01T18:04:31Z","git_url":"git://github.com/Unbabel/unbabel-text-utils.git","ssh_url":"git@github.com:Unbabel/unbabel-text-utils.git","clone_url":"https://github.com/Unbabel/unbabel-text-utils.git","svn_url":"https://github.com/Unbabel/unbabel-text-utils","homepage":null,"size":28371,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"Unbabel:master","ref":"master","sha":"1754497f622e6da0d9e1302a025af61ff5eceded","user":{"login":"Unbabel","id":6173964,"avatar_url":"https://avatars.githubusercontent.com/u/6173964?v=3","gravatar_id":"","url":"https://api.github.com/users/Unbabel","html_url":"https://github.com/Unbabel","followers_url":"https://api.github.com/users/Unbabel/followers","following_url":"https://api.github.com/users/Unbabel/following{/other_user}","gists_url":"https://api.github.com/users/Unbabel/gists{/gist_id}","starred_url":"https://api.github.com/users/Unbabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unbabel/subscriptions","organizations_url":"https://api.github.com/users/Unbabel/orgs","repos_url":"https://api.github.com/users/Unbabel/repos","events_url":"https://api.github.com/users/Unbabel/events{/privacy}","received_events_url":"https://api.github.com/users/Unbabel/received_events","type":"Organization","site_admin":false},"repo":{"id":45260496,"name":"unbabel-text-utils","full_name":"Unbabel/unbabel-text-utils","owner":{"login":"Unbabel","id":6173964,"avatar_url":"https://avatars.githubusercontent.com/u/6173964?v=3","gravatar_id":"","url":"https://api.github.com/users/Unbabel","html_url":"https://github.com/Unbabel","followers_url":"https://api.github.com/users/Unbabel/followers","following_url":"https://api.github.com/users/Unbabel/following{/other_user}","gists_url":"https://api.github.com/users/Unbabel/gists{/gist_id}","starred_url":"https://api.github.com/users/Unbabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unbabel/subscriptions","organizations_url":"https://api.github.com/users/Unbabel/orgs","repos_url":"https://api.github.com/users/Unbabel/repos","events_url":"https://api.github.com/users/Unbabel/events{/privacy}","received_events_url":"https://api.github.com/users/Unbabel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unbabel/unbabel-text-utils","description":"Basic Text Utilities for Unbabel.","fork":false,"url":"https://api.github.com/repos/Unbabel/unbabel-text-utils","forks_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/forks","keys_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/teams","hooks_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/hooks","issue_events_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/events{/number}","events_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/events","assignees_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/assignees{/user}","branches_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/branches{/branch}","tags_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/tags","blobs_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/languages","stargazers_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/stargazers","contributors_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/contributors","subscribers_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/subscribers","subscription_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/subscription","commits_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/contents/{+path}","compare_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/merges","archive_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/downloads","issues_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues{/number}","pulls_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/labels{/name}","releases_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/releases{/id}","deployments_url":"https://api.github.com/repos/Unbabel/unbabel-text-utils/deployments","created_at":"2015-10-30T15:46:48Z","updated_at":"2016-01-15T17:39:29Z","pushed_at":"2016-04-01T18:04:31Z","git_url":"git://github.com/Unbabel/unbabel-text-utils.git","ssh_url":"git@github.com:Unbabel/unbabel-text-utils.git","clone_url":"https://github.com/Unbabel/unbabel-text-utils.git","svn_url":"https://github.com/Unbabel/unbabel-text-utils","homepage":null,"size":28371,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10"},"html":{"href":"https://github.com/Unbabel/unbabel-text-utils/pull/10"},"issue":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/10"},"comments":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/Unbabel/unbabel-text-utils/statuses/f709c4d73ba399638e443278fbf7b38f334d4ec2"}}}}