{"action":"created","comment":{"url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/comments/35003849","id":35003849,"diff_hunk":"@@ -17,9 +17,14 @@ def count_tokens(filename):\n     \"\"\"\n     counts = defaultdict(int)\n     with open(filename, encoding='utf-8', errors='replace') as infile:\n-        for line in infile:\n-            for token in simple_tokenize(line.strip()):\n-                counts[token] += 1\n+        if lang == 'ar':\n+            for line in infile:\n+                for token in simple_tokenize(line):\n+                    counts[standardize_arabic(token)] += 1","path":"wordfreq_builder/wordfreq_builder/word_counts.py","position":25,"original_position":25,"commit_id":"c70ddf00ea814bdbc37f3a5d90c20ec37a3fad90","original_commit_id":"465afb854c2166fc3f2ebbdf956e4ec8bdb9d206","user":{"login":"Joshua-Chin","id":5422226,"avatar_url":"https://avatars.githubusercontent.com/u/5422226?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-Chin","html_url":"https://github.com/Joshua-Chin","followers_url":"https://api.github.com/users/Joshua-Chin/followers","following_url":"https://api.github.com/users/Joshua-Chin/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-Chin/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-Chin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-Chin/subscriptions","organizations_url":"https://api.github.com/users/Joshua-Chin/orgs","repos_url":"https://api.github.com/users/Joshua-Chin/repos","events_url":"https://api.github.com/users/Joshua-Chin/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-Chin/received_events","type":"User","site_admin":false},"body":"The  Arabic standardizer does operated before tokenization. However, we also have to standardize over data source that are not parsed by the wordfreq tokenizer (e.g. Leeds and open-subtitles). I am not sure how much time is saved by having the lang == 'ar' check outside the loop. However, for English, it is the difference between running the check once vs over 6,000,000 times.","created_at":"2015-07-20T15:01:24Z","updated_at":"2015-07-20T15:01:24Z","html_url":"https://github.com/LuminosoInsight/wordfreq/pull/19#discussion_r35003849","pull_request_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/comments/35003849"},"html":{"href":"https://github.com/LuminosoInsight/wordfreq/pull/19#discussion_r35003849"},"pull_request":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19","id":40355390,"html_url":"https://github.com/LuminosoInsight/wordfreq/pull/19","diff_url":"https://github.com/LuminosoInsight/wordfreq/pull/19.diff","patch_url":"https://github.com/LuminosoInsight/wordfreq/pull/19.patch","issue_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/19","number":19,"state":"open","locked":false,"title":"Code review fixes 2015 07 17","user":{"login":"Joshua-Chin","id":5422226,"avatar_url":"https://avatars.githubusercontent.com/u/5422226?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-Chin","html_url":"https://github.com/Joshua-Chin","followers_url":"https://api.github.com/users/Joshua-Chin/followers","following_url":"https://api.github.com/users/Joshua-Chin/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-Chin/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-Chin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-Chin/subscriptions","organizations_url":"https://api.github.com/users/Joshua-Chin/orgs","repos_url":"https://api.github.com/users/Joshua-Chin/repos","events_url":"https://api.github.com/users/Joshua-Chin/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-Chin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-20T14:08:32Z","updated_at":"2015-07-20T15:01:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e9294fd7ae8e76b4fd14e27fffc07b2030ba964","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19/commits","review_comments_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19/comments","review_comment_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/19/comments","statuses_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/statuses/c70ddf00ea814bdbc37f3a5d90c20ec37a3fad90","head":{"label":"LuminosoInsight:code-review-fixes-2015-07-17","ref":"code-review-fixes-2015-07-17","sha":"c70ddf00ea814bdbc37f3a5d90c20ec37a3fad90","user":{"login":"LuminosoInsight","id":1036291,"avatar_url":"https://avatars.githubusercontent.com/u/1036291?v=3","gravatar_id":"","url":"https://api.github.com/users/LuminosoInsight","html_url":"https://github.com/LuminosoInsight","followers_url":"https://api.github.com/users/LuminosoInsight/followers","following_url":"https://api.github.com/users/LuminosoInsight/following{/other_user}","gists_url":"https://api.github.com/users/LuminosoInsight/gists{/gist_id}","starred_url":"https://api.github.com/users/LuminosoInsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuminosoInsight/subscriptions","organizations_url":"https://api.github.com/users/LuminosoInsight/orgs","repos_url":"https://api.github.com/users/LuminosoInsight/repos","events_url":"https://api.github.com/users/LuminosoInsight/events{/privacy}","received_events_url":"https://api.github.com/users/LuminosoInsight/received_events","type":"Organization","site_admin":false},"repo":{"id":13941524,"name":"wordfreq","full_name":"LuminosoInsight/wordfreq","owner":{"login":"LuminosoInsight","id":1036291,"avatar_url":"https://avatars.githubusercontent.com/u/1036291?v=3","gravatar_id":"","url":"https://api.github.com/users/LuminosoInsight","html_url":"https://github.com/LuminosoInsight","followers_url":"https://api.github.com/users/LuminosoInsight/followers","following_url":"https://api.github.com/users/LuminosoInsight/following{/other_user}","gists_url":"https://api.github.com/users/LuminosoInsight/gists{/gist_id}","starred_url":"https://api.github.com/users/LuminosoInsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuminosoInsight/subscriptions","organizations_url":"https://api.github.com/users/LuminosoInsight/orgs","repos_url":"https://api.github.com/users/LuminosoInsight/repos","events_url":"https://api.github.com/users/LuminosoInsight/events{/privacy}","received_events_url":"https://api.github.com/users/LuminosoInsight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LuminosoInsight/wordfreq","description":"Access a database of word frequencies, in various natural languages.","fork":false,"url":"https://api.github.com/repos/LuminosoInsight/wordfreq","forks_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/forks","keys_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/teams","hooks_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/hooks","issue_events_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/events{/number}","events_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/events","assignees_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/assignees{/user}","branches_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/branches{/branch}","tags_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/tags","blobs_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/refs{/sha}","trees_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/statuses/{sha}","languages_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/languages","stargazers_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/stargazers","contributors_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/contributors","subscribers_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/subscribers","subscription_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/subscription","commits_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/commits{/sha}","git_commits_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/commits{/sha}","comments_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/comments{/number}","issue_comment_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/comments{/number}","contents_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/contents/{+path}","compare_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/merges","archive_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/downloads","issues_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues{/number}","pulls_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls{/number}","milestones_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/milestones{/number}","notifications_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/labels{/name}","releases_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/releases{/id}","created_at":"2013-10-28T23:28:12Z","updated_at":"2015-07-10T18:36:13Z","pushed_at":"2015-07-20T14:29:08Z","git_url":"git://github.com/LuminosoInsight/wordfreq.git","ssh_url":"git@github.com:LuminosoInsight/wordfreq.git","clone_url":"https://github.com/LuminosoInsight/wordfreq.git","svn_url":"https://github.com/LuminosoInsight/wordfreq","homepage":null,"size":185945,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":8,"default_branch":"master"}},"base":{"label":"LuminosoInsight:master","ref":"master","sha":"2d1020daac9eb3f4e8116977fc648b0ed431ec36","user":{"login":"LuminosoInsight","id":1036291,"avatar_url":"https://avatars.githubusercontent.com/u/1036291?v=3","gravatar_id":"","url":"https://api.github.com/users/LuminosoInsight","html_url":"https://github.com/LuminosoInsight","followers_url":"https://api.github.com/users/LuminosoInsight/followers","following_url":"https://api.github.com/users/LuminosoInsight/following{/other_user}","gists_url":"https://api.github.com/users/LuminosoInsight/gists{/gist_id}","starred_url":"https://api.github.com/users/LuminosoInsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuminosoInsight/subscriptions","organizations_url":"https://api.github.com/users/LuminosoInsight/orgs","repos_url":"https://api.github.com/users/LuminosoInsight/repos","events_url":"https://api.github.com/users/LuminosoInsight/events{/privacy}","received_events_url":"https://api.github.com/users/LuminosoInsight/received_events","type":"Organization","site_admin":false},"repo":{"id":13941524,"name":"wordfreq","full_name":"LuminosoInsight/wordfreq","owner":{"login":"LuminosoInsight","id":1036291,"avatar_url":"https://avatars.githubusercontent.com/u/1036291?v=3","gravatar_id":"","url":"https://api.github.com/users/LuminosoInsight","html_url":"https://github.com/LuminosoInsight","followers_url":"https://api.github.com/users/LuminosoInsight/followers","following_url":"https://api.github.com/users/LuminosoInsight/following{/other_user}","gists_url":"https://api.github.com/users/LuminosoInsight/gists{/gist_id}","starred_url":"https://api.github.com/users/LuminosoInsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuminosoInsight/subscriptions","organizations_url":"https://api.github.com/users/LuminosoInsight/orgs","repos_url":"https://api.github.com/users/LuminosoInsight/repos","events_url":"https://api.github.com/users/LuminosoInsight/events{/privacy}","received_events_url":"https://api.github.com/users/LuminosoInsight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LuminosoInsight/wordfreq","description":"Access a database of word frequencies, in various natural languages.","fork":false,"url":"https://api.github.com/repos/LuminosoInsight/wordfreq","forks_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/forks","keys_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/teams","hooks_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/hooks","issue_events_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/events{/number}","events_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/events","assignees_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/assignees{/user}","branches_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/branches{/branch}","tags_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/tags","blobs_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/refs{/sha}","trees_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/statuses/{sha}","languages_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/languages","stargazers_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/stargazers","contributors_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/contributors","subscribers_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/subscribers","subscription_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/subscription","commits_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/commits{/sha}","git_commits_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/git/commits{/sha}","comments_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/comments{/number}","issue_comment_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/comments{/number}","contents_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/contents/{+path}","compare_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/merges","archive_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/downloads","issues_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues{/number}","pulls_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls{/number}","milestones_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/milestones{/number}","notifications_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/labels{/name}","releases_url":"https://api.github.com/repos/LuminosoInsight/wordfreq/releases{/id}","created_at":"2013-10-28T23:28:12Z","updated_at":"2015-07-10T18:36:13Z","pushed_at":"2015-07-20T14:29:08Z","git_url":"git://github.com/LuminosoInsight/wordfreq.git","ssh_url":"git@github.com:LuminosoInsight/wordfreq.git","clone_url":"https://github.com/LuminosoInsight/wordfreq.git","svn_url":"https://github.com/LuminosoInsight/wordfreq","homepage":null,"size":185945,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19"},"html":{"href":"https://github.com/LuminosoInsight/wordfreq/pull/19"},"issue":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/19"},"comments":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/LuminosoInsight/wordfreq/statuses/c70ddf00ea814bdbc37f3a5d90c20ec37a3fad90"}}}}