{"action":"created","issue":{"url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/17","repository_url":"https://api.github.com/repos/dimazest/google-ngram-downloader","labels_url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/17/comments","events_url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/17/events","html_url":"https://github.com/dimazest/google-ngram-downloader/issues/17","id":320538730,"number":17,"title":"zlib.error when running next(records)","user":{"login":"Superraptor","id":8202717,"avatar_url":"https://avatars1.githubusercontent.com/u/8202717?v=4","gravatar_id":"","url":"https://api.github.com/users/Superraptor","html_url":"https://github.com/Superraptor","followers_url":"https://api.github.com/users/Superraptor/followers","following_url":"https://api.github.com/users/Superraptor/following{/other_user}","gists_url":"https://api.github.com/users/Superraptor/gists{/gist_id}","starred_url":"https://api.github.com/users/Superraptor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Superraptor/subscriptions","organizations_url":"https://api.github.com/users/Superraptor/orgs","repos_url":"https://api.github.com/users/Superraptor/repos","events_url":"https://api.github.com/users/Superraptor/events{/privacy}","received_events_url":"https://api.github.com/users/Superraptor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-05T20:23:10Z","updated_at":"2018-05-09T15:51:17Z","closed_at":null,"author_association":"NONE","body":"Hi! So I'm getting the following traceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./auxiliary_files/nlp.py\", line 179, in <module>\r\n    if __name__ == \"__main__\": main()\r\n  File \"./auxiliary_files/nlp.py\", line 41, in main\r\n    words_unit_tests(\"29224256\", \"CDK4 Gene Amplification\")\r\n  File \"./auxiliary_files/nlp.py\", line 166, in words_unit_tests\r\n    print(count_google_ngrams_occurrences_of_word(word, ngram_length=2))\r\n  File \"./auxiliary_files/nlp.py\", line 148, in count_google_ngrams_occurrences_of_word\r\n    record = next(records)\r\n  File \"D:\\ProgramData\\Anaconda3\\lib\\site-packages\\google_ngram_downloader\\util.py\", line 41, in lines\r\n    chunk = dec.decompress(compressed_chunk)\r\nzlib.error: Error -3 while decompressing data: incorrect header check\r\n```\r\n\r\nBasically this happens when I'm trying to run:\r\n\r\n```\r\n    fname, url, records = next(readline_google_store(ngram_len=ngram_length, indices=word[0], verbose=True))\r\n        \r\n    try:\r\n        record = next(records)\r\n        while record.ngram != word:\r\n            record = next(records)\r\n        while record.ngram == word:\r\n            count = count + record.match_count\r\n            record = next(records)\r\n    except StopIteration as e:\r\n        pass\r\n    return count\r\n```\r\n\r\nThis is using Python 3.6.5, 64-bit Windows operating system. I tried using some of the decompression techniques [here ](https://stackoverflow.com/questions/3122145/zlib-error-error-3-while-decompressing-incorrect-header-check) but to no avail thus far... Any help would be much appreciated! Thanks so much for a great package!"},"comment":{"url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/comments/387785927","html_url":"https://github.com/dimazest/google-ngram-downloader/issues/17#issuecomment-387785927","issue_url":"https://api.github.com/repos/dimazest/google-ngram-downloader/issues/17","id":387785927,"user":{"login":"Superraptor","id":8202717,"avatar_url":"https://avatars1.githubusercontent.com/u/8202717?v=4","gravatar_id":"","url":"https://api.github.com/users/Superraptor","html_url":"https://github.com/Superraptor","followers_url":"https://api.github.com/users/Superraptor/followers","following_url":"https://api.github.com/users/Superraptor/following{/other_user}","gists_url":"https://api.github.com/users/Superraptor/gists{/gist_id}","starred_url":"https://api.github.com/users/Superraptor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Superraptor/subscriptions","organizations_url":"https://api.github.com/users/Superraptor/orgs","repos_url":"https://api.github.com/users/Superraptor/repos","events_url":"https://api.github.com/users/Superraptor/events{/privacy}","received_events_url":"https://api.github.com/users/Superraptor/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T15:51:17Z","updated_at":"2018-05-09T15:51:17Z","author_association":"NONE","body":"Okay... So I changed the index to `cd` (the first two letters of the word I'm looking up, and I still get the error: \r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./auxiliary_files/nlp.py\", line 192, in <module>\r\n    if __name__ == \"__main__\": main()\r\n  File \"./auxiliary_files/nlp.py\", line 41, in main\r\n    words_unit_tests(\"29224256\", \"CDK4 Gene Amplification\")\r\n  File \"./auxiliary_files/nlp.py\", line 179, in words_unit_tests\r\n    print(count_google_ngrams_occurrences_of_word(word, ngram_length=2))\r\n  File \"./auxiliary_files/nlp.py\", line 159, in count_google_ngrams_occurrences_of_word\r\n    record = next(records)\r\n  File \"D:\\ProgramData\\Anaconda3\\lib\\site-packages\\google_ngram_downloader\\util.py\", line 41, in lines\r\n    chunk = dec.decompress(compressed_chunk)\r\nzlib.error: Error -3 while decompressing data: incorrect header check\r\n```"}}
{"actor":{"display_login":"Superraptor"}}