{"action":"created","issue":{"url":"https://api.github.com/repos/amueller/word_cloud/issues/104","labels_url":"https://api.github.com/repos/amueller/word_cloud/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/amueller/word_cloud/issues/104/comments","events_url":"https://api.github.com/repos/amueller/word_cloud/issues/104/events","html_url":"https://github.com/amueller/word_cloud/issues/104","id":118220448,"number":104,"title":"Not handling contractions properly","user":{"login":"cpenepent","id":12134186,"avatar_url":"https://avatars.githubusercontent.com/u/12134186?v=3","gravatar_id":"","url":"https://api.github.com/users/cpenepent","html_url":"https://github.com/cpenepent","followers_url":"https://api.github.com/users/cpenepent/followers","following_url":"https://api.github.com/users/cpenepent/following{/other_user}","gists_url":"https://api.github.com/users/cpenepent/gists{/gist_id}","starred_url":"https://api.github.com/users/cpenepent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpenepent/subscriptions","organizations_url":"https://api.github.com/users/cpenepent/orgs","repos_url":"https://api.github.com/users/cpenepent/repos","events_url":"https://api.github.com/users/cpenepent/events{/privacy}","received_events_url":"https://api.github.com/users/cpenepent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-21T21:01:52Z","updated_at":"2015-11-27T11:07:22Z","closed_at":null,"body":"I've looked around but haven't been able to find anyone else with a similar issue, so I assume it's a problem with my code.  I could just strip out apostrophes entirely but I'd prefer not to if I don't have to.  This is what I'm getting:\r\n\r\n![wordcloud](http://i.imgur.com/sciUOQK.png)\r\n\r\n(Not sure what the white border is about, a matplotlib thing I'm guessing?)\r\n\r\nI'm grabbing posts from the Tumblr API, my function input here is a list of \"post\" elements from \"response\" elements (see: https://www.tumblr.com/docs/en/api/v2#text-posts).  The API uses Unicode for everything (text posts, tags, even the dictionary keys for the JSON response object), hence the encoding.\r\n\r\n```python\r\ndef get_text_posts(posts):\r\n\ttext_posts = {}\r\n\tfor p in posts:\r\n\t\tif u'body' in p:\r\n\t\t\tpost_id = str(p[u'id'])\r\n\t\t\ttext = p[u'body'].encode('utf-8','replace')\r\n\t\t\tif '`' in text: #standardize apostrophes\r\n\t\t\t\ttext = text.replace('`','\\'')\r\n\t\t\ttext_posts[post_id] = str.lower(text)\r\n\r\n#master_textposts is a dictionary mapping post ids to strings\r\ndef generate_wordcloud(master_textposts):\r\n\ttext = '\\n'.join(master_textposts.values())\r\n\twordcloud = WordCloud().generate(text)\r\n\tplt.figure()\r\n\tplt.imshow(wordcloud)\r\n\tplt.axis(\"off\")\r\n\tplt.show()\r\n```\r\n\r\nCould something with my text encoding chicanery here be causing problems when I send the posts to Wordcloud?  My comprehension of text encoding is admittedly shoddy at best."},"comment":{"url":"https://api.github.com/repos/amueller/word_cloud/issues/comments/160115635","html_url":"https://github.com/amueller/word_cloud/issues/104#issuecomment-160115635","issue_url":"https://api.github.com/repos/amueller/word_cloud/issues/104","id":160115635,"user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T11:07:22Z","updated_at":"2015-11-27T11:07:22Z","body":"hm can't you use ``replace``? or just add it into the ``[]``?"}}