{"action":"created","comment":{"url":"https://api.github.com/repos/pasby/java-battle/pulls/comments/58758032","id":58758032,"diff_hunk":"@@ -0,0 +1,89 @@\n+package textDictionary;\n+\n+import java.io.BufferedReader;\n+import java.io.FileReader;\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.Iterator;\n+\n+public class CreateDictionary {\n+    private String filePath;\n+\n+    public CreateDictionary(String filePath) {\n+        this.filePath = filePath;\n+    }\n+\n+    public HashMap getResult() {\n+        try {\n+            ArrayList wordsList = getWordsFromFile();\n+            HashSet wordsSet = convertToSet(wordsList);\n+            return countWords(wordsSet, wordsList);\n+        } catch (IOException e) {\n+            System.out.println(e);\n+            System.exit(-1);\n+        }\n+        return null;\n+    }\n+\n+    private ArrayList getWordsFromFile() throws IOException {\n+        ArrayList wordsArray = new ArrayList();\n+        FileReader fr = new FileReader(filePath);\n+        BufferedReader textReader = new BufferedReader(fr);\n+        String textLine;\n+        while ((textLine = textReader.readLine()) != null) { // to the end of file\n+            String[] wordsInLine = textLine.split(\" \"); // split string to words","path":"gadd/src/main/java/textDictionary/CreateDictionary.java","position":36,"original_position":36,"commit_id":"45e28525f363c0fad96530c541c07103517fe384","original_commit_id":"45e28525f363c0fad96530c541c07103517fe384","user":{"login":"pasby","id":18141302,"avatar_url":"https://avatars.githubusercontent.com/u/18141302?v=3","gravatar_id":"","url":"https://api.github.com/users/pasby","html_url":"https://github.com/pasby","followers_url":"https://api.github.com/users/pasby/followers","following_url":"https://api.github.com/users/pasby/following{/other_user}","gists_url":"https://api.github.com/users/pasby/gists{/gist_id}","starred_url":"https://api.github.com/users/pasby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasby/subscriptions","organizations_url":"https://api.github.com/users/pasby/orgs","repos_url":"https://api.github.com/users/pasby/repos","events_url":"https://api.github.com/users/pasby/events{/privacy}","received_events_url":"https://api.github.com/users/pasby/received_events","type":"User","site_admin":false},"body":"what about dots or commas or other punctuation?","created_at":"2016-04-06T18:33:47Z","updated_at":"2016-04-06T18:33:47Z","html_url":"https://github.com/pasby/java-battle/pull/8#discussion_r58758032","pull_request_url":"https://api.github.com/repos/pasby/java-battle/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/comments/58758032"},"html":{"href":"https://github.com/pasby/java-battle/pull/8#discussion_r58758032"},"pull_request":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/pasby/java-battle/pulls/8","id":65493299,"html_url":"https://github.com/pasby/java-battle/pull/8","diff_url":"https://github.com/pasby/java-battle/pull/8.diff","patch_url":"https://github.com/pasby/java-battle/pull/8.patch","issue_url":"https://api.github.com/repos/pasby/java-battle/issues/8","number":8,"state":"open","locked":false,"title":"Number finder","user":{"login":"Gaddsky","id":18151759,"avatar_url":"https://avatars.githubusercontent.com/u/18151759?v=3","gravatar_id":"","url":"https://api.github.com/users/Gaddsky","html_url":"https://github.com/Gaddsky","followers_url":"https://api.github.com/users/Gaddsky/followers","following_url":"https://api.github.com/users/Gaddsky/following{/other_user}","gists_url":"https://api.github.com/users/Gaddsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaddsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaddsky/subscriptions","organizations_url":"https://api.github.com/users/Gaddsky/orgs","repos_url":"https://api.github.com/users/Gaddsky/repos","events_url":"https://api.github.com/users/Gaddsky/events{/privacy}","received_events_url":"https://api.github.com/users/Gaddsky/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-06T16:08:42Z","updated_at":"2016-04-06T18:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efabbd390984265dbdca3bd4b4e672b5c904ef22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pasby/java-battle/pulls/8/commits","review_comments_url":"https://api.github.com/repos/pasby/java-battle/pulls/8/comments","review_comment_url":"https://api.github.com/repos/pasby/java-battle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pasby/java-battle/issues/8/comments","statuses_url":"https://api.github.com/repos/pasby/java-battle/statuses/45e28525f363c0fad96530c541c07103517fe384","head":{"label":"Gaddsky:numberFinder","ref":"numberFinder","sha":"45e28525f363c0fad96530c541c07103517fe384","user":{"login":"Gaddsky","id":18151759,"avatar_url":"https://avatars.githubusercontent.com/u/18151759?v=3","gravatar_id":"","url":"https://api.github.com/users/Gaddsky","html_url":"https://github.com/Gaddsky","followers_url":"https://api.github.com/users/Gaddsky/followers","following_url":"https://api.github.com/users/Gaddsky/following{/other_user}","gists_url":"https://api.github.com/users/Gaddsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaddsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaddsky/subscriptions","organizations_url":"https://api.github.com/users/Gaddsky/orgs","repos_url":"https://api.github.com/users/Gaddsky/repos","events_url":"https://api.github.com/users/Gaddsky/events{/privacy}","received_events_url":"https://api.github.com/users/Gaddsky/received_events","type":"User","site_admin":false},"repo":{"id":55007972,"name":"java-battle","full_name":"Gaddsky/java-battle","owner":{"login":"Gaddsky","id":18151759,"avatar_url":"https://avatars.githubusercontent.com/u/18151759?v=3","gravatar_id":"","url":"https://api.github.com/users/Gaddsky","html_url":"https://github.com/Gaddsky","followers_url":"https://api.github.com/users/Gaddsky/followers","following_url":"https://api.github.com/users/Gaddsky/following{/other_user}","gists_url":"https://api.github.com/users/Gaddsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaddsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaddsky/subscriptions","organizations_url":"https://api.github.com/users/Gaddsky/orgs","repos_url":"https://api.github.com/users/Gaddsky/repos","events_url":"https://api.github.com/users/Gaddsky/events{/privacy}","received_events_url":"https://api.github.com/users/Gaddsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gaddsky/java-battle","description":"test repo for studying java","fork":true,"url":"https://api.github.com/repos/Gaddsky/java-battle","forks_url":"https://api.github.com/repos/Gaddsky/java-battle/forks","keys_url":"https://api.github.com/repos/Gaddsky/java-battle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gaddsky/java-battle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gaddsky/java-battle/teams","hooks_url":"https://api.github.com/repos/Gaddsky/java-battle/hooks","issue_events_url":"https://api.github.com/repos/Gaddsky/java-battle/issues/events{/number}","events_url":"https://api.github.com/repos/Gaddsky/java-battle/events","assignees_url":"https://api.github.com/repos/Gaddsky/java-battle/assignees{/user}","branches_url":"https://api.github.com/repos/Gaddsky/java-battle/branches{/branch}","tags_url":"https://api.github.com/repos/Gaddsky/java-battle/tags","blobs_url":"https://api.github.com/repos/Gaddsky/java-battle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gaddsky/java-battle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gaddsky/java-battle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gaddsky/java-battle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gaddsky/java-battle/statuses/{sha}","languages_url":"https://api.github.com/repos/Gaddsky/java-battle/languages","stargazers_url":"https://api.github.com/repos/Gaddsky/java-battle/stargazers","contributors_url":"https://api.github.com/repos/Gaddsky/java-battle/contributors","subscribers_url":"https://api.github.com/repos/Gaddsky/java-battle/subscribers","subscription_url":"https://api.github.com/repos/Gaddsky/java-battle/subscription","commits_url":"https://api.github.com/repos/Gaddsky/java-battle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gaddsky/java-battle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gaddsky/java-battle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gaddsky/java-battle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gaddsky/java-battle/contents/{+path}","compare_url":"https://api.github.com/repos/Gaddsky/java-battle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gaddsky/java-battle/merges","archive_url":"https://api.github.com/repos/Gaddsky/java-battle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gaddsky/java-battle/downloads","issues_url":"https://api.github.com/repos/Gaddsky/java-battle/issues{/number}","pulls_url":"https://api.github.com/repos/Gaddsky/java-battle/pulls{/number}","milestones_url":"https://api.github.com/repos/Gaddsky/java-battle/milestones{/number}","notifications_url":"https://api.github.com/repos/Gaddsky/java-battle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gaddsky/java-battle/labels{/name}","releases_url":"https://api.github.com/repos/Gaddsky/java-battle/releases{/id}","deployments_url":"https://api.github.com/repos/Gaddsky/java-battle/deployments","created_at":"2016-03-29T20:22:38Z","updated_at":"2016-03-31T20:11:32Z","pushed_at":"2016-04-06T16:04:28Z","git_url":"git://github.com/Gaddsky/java-battle.git","ssh_url":"git@github.com:Gaddsky/java-battle.git","clone_url":"https://github.com/Gaddsky/java-battle.git","svn_url":"https://github.com/Gaddsky/java-battle","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pasby:master","ref":"master","sha":"41fb08c78167be98bab95edcf9f5ed8243f57883","user":{"login":"pasby","id":18141302,"avatar_url":"https://avatars.githubusercontent.com/u/18141302?v=3","gravatar_id":"","url":"https://api.github.com/users/pasby","html_url":"https://github.com/pasby","followers_url":"https://api.github.com/users/pasby/followers","following_url":"https://api.github.com/users/pasby/following{/other_user}","gists_url":"https://api.github.com/users/pasby/gists{/gist_id}","starred_url":"https://api.github.com/users/pasby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasby/subscriptions","organizations_url":"https://api.github.com/users/pasby/orgs","repos_url":"https://api.github.com/users/pasby/repos","events_url":"https://api.github.com/users/pasby/events{/privacy}","received_events_url":"https://api.github.com/users/pasby/received_events","type":"User","site_admin":false},"repo":{"id":54970177,"name":"java-battle","full_name":"pasby/java-battle","owner":{"login":"pasby","id":18141302,"avatar_url":"https://avatars.githubusercontent.com/u/18141302?v=3","gravatar_id":"","url":"https://api.github.com/users/pasby","html_url":"https://github.com/pasby","followers_url":"https://api.github.com/users/pasby/followers","following_url":"https://api.github.com/users/pasby/following{/other_user}","gists_url":"https://api.github.com/users/pasby/gists{/gist_id}","starred_url":"https://api.github.com/users/pasby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasby/subscriptions","organizations_url":"https://api.github.com/users/pasby/orgs","repos_url":"https://api.github.com/users/pasby/repos","events_url":"https://api.github.com/users/pasby/events{/privacy}","received_events_url":"https://api.github.com/users/pasby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pasby/java-battle","description":"test repo for studying java","fork":false,"url":"https://api.github.com/repos/pasby/java-battle","forks_url":"https://api.github.com/repos/pasby/java-battle/forks","keys_url":"https://api.github.com/repos/pasby/java-battle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pasby/java-battle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pasby/java-battle/teams","hooks_url":"https://api.github.com/repos/pasby/java-battle/hooks","issue_events_url":"https://api.github.com/repos/pasby/java-battle/issues/events{/number}","events_url":"https://api.github.com/repos/pasby/java-battle/events","assignees_url":"https://api.github.com/repos/pasby/java-battle/assignees{/user}","branches_url":"https://api.github.com/repos/pasby/java-battle/branches{/branch}","tags_url":"https://api.github.com/repos/pasby/java-battle/tags","blobs_url":"https://api.github.com/repos/pasby/java-battle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pasby/java-battle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pasby/java-battle/git/refs{/sha}","trees_url":"https://api.github.com/repos/pasby/java-battle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pasby/java-battle/statuses/{sha}","languages_url":"https://api.github.com/repos/pasby/java-battle/languages","stargazers_url":"https://api.github.com/repos/pasby/java-battle/stargazers","contributors_url":"https://api.github.com/repos/pasby/java-battle/contributors","subscribers_url":"https://api.github.com/repos/pasby/java-battle/subscribers","subscription_url":"https://api.github.com/repos/pasby/java-battle/subscription","commits_url":"https://api.github.com/repos/pasby/java-battle/commits{/sha}","git_commits_url":"https://api.github.com/repos/pasby/java-battle/git/commits{/sha}","comments_url":"https://api.github.com/repos/pasby/java-battle/comments{/number}","issue_comment_url":"https://api.github.com/repos/pasby/java-battle/issues/comments{/number}","contents_url":"https://api.github.com/repos/pasby/java-battle/contents/{+path}","compare_url":"https://api.github.com/repos/pasby/java-battle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pasby/java-battle/merges","archive_url":"https://api.github.com/repos/pasby/java-battle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pasby/java-battle/downloads","issues_url":"https://api.github.com/repos/pasby/java-battle/issues{/number}","pulls_url":"https://api.github.com/repos/pasby/java-battle/pulls{/number}","milestones_url":"https://api.github.com/repos/pasby/java-battle/milestones{/number}","notifications_url":"https://api.github.com/repos/pasby/java-battle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pasby/java-battle/labels{/name}","releases_url":"https://api.github.com/repos/pasby/java-battle/releases{/id}","deployments_url":"https://api.github.com/repos/pasby/java-battle/deployments","created_at":"2016-03-29T11:26:41Z","updated_at":"2016-04-01T16:04:51Z","pushed_at":"2016-04-06T18:25:13Z","git_url":"git://github.com/pasby/java-battle.git","ssh_url":"git@github.com:pasby/java-battle.git","clone_url":"https://github.com/pasby/java-battle.git","svn_url":"https://github.com/pasby/java-battle","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/8"},"html":{"href":"https://github.com/pasby/java-battle/pull/8"},"issue":{"href":"https://api.github.com/repos/pasby/java-battle/issues/8"},"comments":{"href":"https://api.github.com/repos/pasby/java-battle/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pasby/java-battle/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/pasby/java-battle/statuses/45e28525f363c0fad96530c541c07103517fe384"}}}}