{"action":"created","issue":{"url":"https://api.github.com/repos/nltk/nltk/issues/1293","repository_url":"https://api.github.com/repos/nltk/nltk","labels_url":"https://api.github.com/repos/nltk/nltk/issues/1293/labels{/name}","comments_url":"https://api.github.com/repos/nltk/nltk/issues/1293/comments","events_url":"https://api.github.com/repos/nltk/nltk/issues/1293/events","html_url":"https://github.com/nltk/nltk/issues/1293","id":135320459,"number":1293,"title":"Gale-Church aligner raises TypeError","user":{"login":"cassidylaidlaw","id":9619275,"avatar_url":"https://avatars.githubusercontent.com/u/9619275?v=3","gravatar_id":"","url":"https://api.github.com/users/cassidylaidlaw","html_url":"https://github.com/cassidylaidlaw","followers_url":"https://api.github.com/users/cassidylaidlaw/followers","following_url":"https://api.github.com/users/cassidylaidlaw/following{/other_user}","gists_url":"https://api.github.com/users/cassidylaidlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/cassidylaidlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cassidylaidlaw/subscriptions","organizations_url":"https://api.github.com/users/cassidylaidlaw/orgs","repos_url":"https://api.github.com/users/cassidylaidlaw/repos","events_url":"https://api.github.com/users/cassidylaidlaw/events{/privacy}","received_events_url":"https://api.github.com/users/cassidylaidlaw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nltk/nltk/labels/SMT","name":"SMT","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-22T05:15:32Z","updated_at":"2016-04-18T06:45:38Z","closed_at":null,"body":"Running\r\n\r\n    nltk.translate.gale_church.align_blocks([10] * 20, [200, 400])\r\n\r\nraises\r\n\r\n    TypeError: 'NoneType' object is not iterable\r\n\r\n----\r\n\r\nExample:\r\n\r\n```python\r\n>>> from nltk.translate import gale_church\r\n>>> gale_church.align_blocks([5,5,5], [7,7,7])\r\n[(0, 0), (1, 1), (2, 2)]\r\n>>> gale_church.align_blocks([10,] * 20, [5])\r\n[(18, 0), (19, 0)]\r\n>>> gale_church.align_blocks([10,] * 20, [5, 10])\r\n[(16, 0), (17, 0), (18, 1), (19, 1)]\r\n>>> gale_church.align_blocks([10] * 20, [5, 10])\r\n[(16, 0), (17, 0), (18, 1), (19, 1)]\r\n>>> gale_church.align_blocks([10] * 20, [200, 400])\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"nltk/translate/gale_church.py\", line 168, in align_blocks\r\n    return trace(backlinks, source_sents, target_sents)\r\n  File \"nltk/translate/gale_church.py\", line 84, in trace\r\n    s, t = backlinks[pos]\r\nTypeError: 'NoneType' object is not iterable\r\n```"},"comment":{"url":"https://api.github.com/repos/nltk/nltk/issues/comments/211229258","html_url":"https://github.com/nltk/nltk/issues/1293#issuecomment-211229258","issue_url":"https://api.github.com/repos/nltk/nltk/issues/1293","id":211229258,"user":{"login":"alvations","id":1050316,"avatar_url":"https://avatars.githubusercontent.com/u/1050316?v=3","gravatar_id":"","url":"https://api.github.com/users/alvations","html_url":"https://github.com/alvations","followers_url":"https://api.github.com/users/alvations/followers","following_url":"https://api.github.com/users/alvations/following{/other_user}","gists_url":"https://api.github.com/users/alvations/gists{/gist_id}","starred_url":"https://api.github.com/users/alvations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvations/subscriptions","organizations_url":"https://api.github.com/users/alvations/orgs","repos_url":"https://api.github.com/users/alvations/repos","events_url":"https://api.github.com/users/alvations/events{/privacy}","received_events_url":"https://api.github.com/users/alvations/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T06:45:38Z","updated_at":"2016-04-18T06:45:38Z","body":"After referencing my old code, I realize that NLTK is still saving the traces differently from @vchahun's implementation, https://github.com/alvations/NTU-MC/blob/master/ntumc/toolkit/gale_church.py#L115"}}