{"action":"created","issue":{"url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/5","labels_url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/5/comments","events_url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/5/events","html_url":"https://github.com/rsennrich/subword-nmt/issues/5","id":129726719,"number":5,"title":"replace_pair in learn_bpe.py throws exception for strings that end with escape char (backslash)","user":{"login":"dblandan","id":6475564,"avatar_url":"https://avatars.githubusercontent.com/u/6475564?v=3","gravatar_id":"","url":"https://api.github.com/users/dblandan","html_url":"https://github.com/dblandan","followers_url":"https://api.github.com/users/dblandan/followers","following_url":"https://api.github.com/users/dblandan/following{/other_user}","gists_url":"https://api.github.com/users/dblandan/gists{/gist_id}","starred_url":"https://api.github.com/users/dblandan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblandan/subscriptions","organizations_url":"https://api.github.com/users/dblandan/orgs","repos_url":"https://api.github.com/users/dblandan/repos","events_url":"https://api.github.com/users/dblandan/events{/privacy}","received_events_url":"https://api.github.com/users/dblandan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-29T10:31:36Z","updated_at":"2016-01-29T11:32:28Z","closed_at":"2016-01-29T10:54:49Z","body":"pair 1920: \\pccsrv \\ -> \\pccsrv\\ (frequency 2798)\r\nTraceback (most recent call last):\r\n  File \"./learn_bpe.py\", line 201, in <module>\r\n    changes = replace_pair(most_frequent, sorted_vocab, indices)\r\n  File \"./learn_bpe.py\", line 145, in replace_pair\r\n    new_word = pattern.sub(pair_str, new_word)\r\n  File \"/usr/lib/python2.7/re.py\", line 273, in _subx\r\n    template = _compile_repl(template, pattern)\r\n  File \"/usr/lib/python2.7/re.py\", line 260, in _compile_repl\r\n    raise error, v # invalid expression\r\nsre_constants.error: bogus escape (end of line)\r\n"},"comment":{"url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/comments/176704520","html_url":"https://github.com/rsennrich/subword-nmt/issues/5#issuecomment-176704520","issue_url":"https://api.github.com/repos/rsennrich/subword-nmt/issues/5","id":176704520,"user":{"login":"dblandan","id":6475564,"avatar_url":"https://avatars.githubusercontent.com/u/6475564?v=3","gravatar_id":"","url":"https://api.github.com/users/dblandan","html_url":"https://github.com/dblandan","followers_url":"https://api.github.com/users/dblandan/followers","following_url":"https://api.github.com/users/dblandan/following{/other_user}","gists_url":"https://api.github.com/users/dblandan/gists{/gist_id}","starred_url":"https://api.github.com/users/dblandan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblandan/subscriptions","organizations_url":"https://api.github.com/users/dblandan/orgs","repos_url":"https://api.github.com/users/dblandan/repos","events_url":"https://api.github.com/users/dblandan/events{/privacy}","received_events_url":"https://api.github.com/users/dblandan/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T11:32:28Z","updated_at":"2016-01-29T11:32:28Z","body":"OK, sorry.  works for me now.  I must've munged something somewhere.  clean\ngit clone did the trick.  :-)\n\nthanks again!!\n-d\n\nOn Fri, Jan 29, 2016 at 11:19 AM, Rico Sennrich <notifications@github.com>\nwrote:\n\n> I tested learn_bpe.py on a toy corpus consisting of your line twice, and\n> this works for me.\n>\n> If this fails for you, which python version are you using? Could you\n> please also double-check if your repo's working directory is clean and\n> contains the fixed version of learn_bpe.py?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/rsennrich/subword-nmt/issues/5#issuecomment-176699367>\n> .\n>\n"}}