{"action":"created","comment":{"url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/comments/94632488","pull_request_review_id":15163755,"id":94632488,"diff_hunk":"@@ -0,0 +1,99 @@\n+'use strict';\n+\n+class Index {\n+  constructor() {\n+    this.index = {};\n+    this.files = null;\n+\n+    // Stop words source:\n+    // http://www.ranks.nl/stopwords\n+    this.stopWords = ['a', 'about', 'above', 'after', 'again', 'against', 'all',\n+    'am', 'an', 'and', 'any', 'are', 'aren\\'t', 'as', 'at', 'be', 'because',\n+    'been', 'before', 'being', 'below', 'between', 'both', 'but', 'by',\n+    'can\\'t', 'cannot', 'could', 'couldn\\'t', 'did', 'didn\\'t', 'do', 'does',\n+    'doesn\\'t', 'doing', 'don\\'t', 'down', 'during', 'each', 'few', 'for',\n+    'from', 'further', 'had', 'hadn\\'t', 'has', 'hasn\\'t', 'have', 'haven\\'t',\n+    'having', 'he', 'he\\'d', 'he\\'ll', 'he\\'s', 'her', 'here', 'here\\'s',\n+    'hers', 'herself', 'him', 'himself', 'his', 'how', 'how\\'s', 'i', 'i\\'d',\n+    'i\\'ll', 'i\\'m', 'i\\'ve', 'if', 'in', 'into', 'is', 'isn\\'t', 'it', 'it\\'s',\n+    'its', 'itself', 'let\\'s', 'me', 'more', 'most', 'mustn\\'t', 'my', 'myself',\n+    'no', 'nor', 'not', 'of', 'off', 'on', 'once', 'only', 'or', 'other',\n+    'ought', 'our', 'ours', 'ourselves', 'out', 'over', 'own', 'same',\n+    'shan\\'t', 'she', 'she\\'d', 'she\\'ll', 'she\\'s', 'should','shouldn\\'t',\n+    'so', 'some', 'such', 'than', 'that', 'that\\'s', 'the', 'their', 'theirs',\n+    'them', 'themselves', 'then', 'there', 'there\\'s', 'these', 'they',\n+    'they\\'d', 'they\\'ll', 'they\\'re', 'they\\'ve', 'this', 'those', 'through',\n+    'to', 'too', 'under', 'until', 'up', 'very', 'was', 'wasn\\'t', 'we',\n+    'we\\'d', 'we\\'ll', 'we\\'re', 'we\\'ve', 'were', 'weren\\'t', 'what',\n+    'what\\'s', 'when', 'when\\'s', 'where', 'where\\'s', 'which', 'while', 'who',\n+    'who\\'s', 'whom', 'why', 'why\\'s', 'with', 'won\\'t', 'would', 'wouldn\\'t',\n+    'you', 'you\\'d', 'you\\'ll', 'you\\'re', 'you\\'ve', 'your', 'yours',\n+    'yourself', 'yourselves'\n+  ];\n+  }\n+\n+  readJSON(filePath) {\n+    let readRequest = new XMLHttpRequest();\n+    readRequest.open('GET', filePath, true);\n+    readRequest.onreadystatechange = function() {\n+      if (readRequest.status === 200 && readRequest.readyState === 4) {\n+        if (readRequest.responseText.trim().length === 0) {\n+          throw Error(\"Empty file detected\")\n+        }\n+        try {\n+          JSON.parse(readRequest.responseText);\n+        }\n+        catch(err) {\n+          throw Error(\"Invalid file type\")","path":"src/inverted-index.js","position":47,"original_position":47,"commit_id":"acd238662786fd6adc1ba01a0ef4e9584e6af123","original_commit_id":"acd238662786fd6adc1ba01a0ef4e9584e6af123","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Missing semicolon.](https://www.codacy.com/app/jackline-macharia/inverted-index/file/4872003529/issues/source?bid=4047942&fileBranchId=4048354#l47)","created_at":"2017-01-04T18:04:12Z","updated_at":"2017-01-04T18:04:12Z","html_url":"https://github.com/andela-jmacharia/inverted-index/pull/3#discussion_r94632488","pull_request_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/comments/94632488"},"html":{"href":"https://github.com/andela-jmacharia/inverted-index/pull/3#discussion_r94632488"},"pull_request":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3","id":100143016,"html_url":"https://github.com/andela-jmacharia/inverted-index/pull/3","diff_url":"https://github.com/andela-jmacharia/inverted-index/pull/3.diff","patch_url":"https://github.com/andela-jmacharia/inverted-index/pull/3.patch","issue_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/3","number":3,"state":"open","locked":false,"title":"Feature/logic","user":{"login":"andela-jmacharia","id":16131515,"avatar_url":"https://avatars.githubusercontent.com/u/16131515?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jmacharia","html_url":"https://github.com/andela-jmacharia","followers_url":"https://api.github.com/users/andela-jmacharia/followers","following_url":"https://api.github.com/users/andela-jmacharia/following{/other_user}","gists_url":"https://api.github.com/users/andela-jmacharia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jmacharia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jmacharia/subscriptions","organizations_url":"https://api.github.com/users/andela-jmacharia/orgs","repos_url":"https://api.github.com/users/andela-jmacharia/repos","events_url":"https://api.github.com/users/andela-jmacharia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jmacharia/received_events","type":"User","site_admin":false},"body":"Codacy test","created_at":"2017-01-04T16:19:41Z","updated_at":"2017-01-04T18:04:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebbeece2dbd3a839f422866058da7a29250ec248","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3/commits","review_comments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3/comments","review_comment_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/3/comments","statuses_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/statuses/acd238662786fd6adc1ba01a0ef4e9584e6af123","head":{"label":"andela-jmacharia:feature/logic","ref":"feature/logic","sha":"acd238662786fd6adc1ba01a0ef4e9584e6af123","user":{"login":"andela-jmacharia","id":16131515,"avatar_url":"https://avatars.githubusercontent.com/u/16131515?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jmacharia","html_url":"https://github.com/andela-jmacharia","followers_url":"https://api.github.com/users/andela-jmacharia/followers","following_url":"https://api.github.com/users/andela-jmacharia/following{/other_user}","gists_url":"https://api.github.com/users/andela-jmacharia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jmacharia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jmacharia/subscriptions","organizations_url":"https://api.github.com/users/andela-jmacharia/orgs","repos_url":"https://api.github.com/users/andela-jmacharia/repos","events_url":"https://api.github.com/users/andela-jmacharia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jmacharia/received_events","type":"User","site_admin":false},"repo":{"id":76537363,"name":"inverted-index","full_name":"andela-jmacharia/inverted-index","owner":{"login":"andela-jmacharia","id":16131515,"avatar_url":"https://avatars.githubusercontent.com/u/16131515?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jmacharia","html_url":"https://github.com/andela-jmacharia","followers_url":"https://api.github.com/users/andela-jmacharia/followers","following_url":"https://api.github.com/users/andela-jmacharia/following{/other_user}","gists_url":"https://api.github.com/users/andela-jmacharia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jmacharia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jmacharia/subscriptions","organizations_url":"https://api.github.com/users/andela-jmacharia/orgs","repos_url":"https://api.github.com/users/andela-jmacharia/repos","events_url":"https://api.github.com/users/andela-jmacharia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jmacharia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-jmacharia/inverted-index","description":"Checkpoint 1","fork":false,"url":"https://api.github.com/repos/andela-jmacharia/inverted-index","forks_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/forks","keys_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/teams","hooks_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/hooks","issue_events_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/events{/number}","events_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/events","assignees_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/assignees{/user}","branches_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/branches{/branch}","tags_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/tags","blobs_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/languages","stargazers_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/stargazers","contributors_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/contributors","subscribers_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/subscribers","subscription_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/subscription","commits_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/contents/{+path}","compare_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/merges","archive_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/downloads","issues_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues{/number}","pulls_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/labels{/name}","releases_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/releases{/id}","deployments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/deployments","created_at":"2016-12-15T07:59:53Z","updated_at":"2016-12-25T11:27:53Z","pushed_at":"2017-01-04T18:02:35Z","git_url":"git://github.com/andela-jmacharia/inverted-index.git","ssh_url":"git@github.com:andela-jmacharia/inverted-index.git","clone_url":"https://github.com/andela-jmacharia/inverted-index.git","svn_url":"https://github.com/andela-jmacharia/inverted-index","homepage":"","size":40,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"default_branch":"develop"}},"base":{"label":"andela-jmacharia:develop","ref":"develop","sha":"6c3d5dd769e69ef26e5ff9c161c7b690ac3e1d36","user":{"login":"andela-jmacharia","id":16131515,"avatar_url":"https://avatars.githubusercontent.com/u/16131515?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jmacharia","html_url":"https://github.com/andela-jmacharia","followers_url":"https://api.github.com/users/andela-jmacharia/followers","following_url":"https://api.github.com/users/andela-jmacharia/following{/other_user}","gists_url":"https://api.github.com/users/andela-jmacharia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jmacharia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jmacharia/subscriptions","organizations_url":"https://api.github.com/users/andela-jmacharia/orgs","repos_url":"https://api.github.com/users/andela-jmacharia/repos","events_url":"https://api.github.com/users/andela-jmacharia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jmacharia/received_events","type":"User","site_admin":false},"repo":{"id":76537363,"name":"inverted-index","full_name":"andela-jmacharia/inverted-index","owner":{"login":"andela-jmacharia","id":16131515,"avatar_url":"https://avatars.githubusercontent.com/u/16131515?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jmacharia","html_url":"https://github.com/andela-jmacharia","followers_url":"https://api.github.com/users/andela-jmacharia/followers","following_url":"https://api.github.com/users/andela-jmacharia/following{/other_user}","gists_url":"https://api.github.com/users/andela-jmacharia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jmacharia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jmacharia/subscriptions","organizations_url":"https://api.github.com/users/andela-jmacharia/orgs","repos_url":"https://api.github.com/users/andela-jmacharia/repos","events_url":"https://api.github.com/users/andela-jmacharia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jmacharia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-jmacharia/inverted-index","description":"Checkpoint 1","fork":false,"url":"https://api.github.com/repos/andela-jmacharia/inverted-index","forks_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/forks","keys_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/teams","hooks_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/hooks","issue_events_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/events{/number}","events_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/events","assignees_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/assignees{/user}","branches_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/branches{/branch}","tags_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/tags","blobs_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/languages","stargazers_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/stargazers","contributors_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/contributors","subscribers_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/subscribers","subscription_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/subscription","commits_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/contents/{+path}","compare_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/merges","archive_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/downloads","issues_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues{/number}","pulls_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/labels{/name}","releases_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/releases{/id}","deployments_url":"https://api.github.com/repos/andela-jmacharia/inverted-index/deployments","created_at":"2016-12-15T07:59:53Z","updated_at":"2016-12-25T11:27:53Z","pushed_at":"2017-01-04T18:02:35Z","git_url":"git://github.com/andela-jmacharia/inverted-index.git","ssh_url":"git@github.com:andela-jmacharia/inverted-index.git","clone_url":"https://github.com/andela-jmacharia/inverted-index.git","svn_url":"https://github.com/andela-jmacharia/inverted-index","homepage":"","size":40,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3"},"html":{"href":"https://github.com/andela-jmacharia/inverted-index/pull/3"},"issue":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/3"},"comments":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/andela-jmacharia/inverted-index/statuses/acd238662786fd6adc1ba01a0ef4e9584e6af123"}}}}
{"actor":{"display_login":"codacy-bot"}}