{"action":"created","comment":{"url":"https://api.github.com/repos/apache/nutch/pulls/comments/32702813","id":32702813,"diff_hunk":"@@ -0,0 +1,234 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.apache.nutch.urlfilter.model;\n+\n+import java.io.BufferedReader;\n+import java.io.FileReader;\n+import java.io.IOException;\n+import java.io.StringReader;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+import org.apache.hadoop.io.IntWritable;\n+import org.apache.hadoop.io.LongWritable;\n+import org.apache.hadoop.io.SequenceFile;\n+import org.apache.hadoop.io.SequenceFile.Writer;\n+import org.apache.hadoop.io.Text;\n+import org.apache.lucene.analysis.Analyzer;\n+import org.apache.lucene.analysis.TokenStream;\n+import org.apache.lucene.analysis.standard.StandardAnalyzer;\n+import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;\n+import org.apache.lucene.util.Version;\n+import org.apache.mahout.classifier.naivebayes.BayesUtils;\n+import org.apache.mahout.classifier.naivebayes.NaiveBayesModel;\n+import org.apache.mahout.classifier.naivebayes.StandardNaiveBayesClassifier;\n+import org.apache.mahout.classifier.naivebayes.training.TrainNaiveBayesJob;\n+import org.apache.mahout.common.Pair;\n+import org.apache.mahout.common.iterator.sequencefile.SequenceFileIterable;\n+import org.apache.mahout.math.RandomAccessSparseVector;\n+import org.apache.mahout.math.Vector;\n+import org.apache.mahout.math.Vector.Element;\n+import org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles;\n+import org.apache.mahout.vectorizer.TFIDF;\n+\n+import com.google.common.collect.ConcurrentHashMultiset;\n+import com.google.common.collect.Multiset;\n+\n+public class NBClassifier {","path":"src/plugin/urlfilter-model/src/java/org/apache/nutch/urlfilter/model/NBClassifier.java","position":55,"original_position":55,"commit_id":"711f44d8d4af51538ff1764145ac743445b6f43b","original_commit_id":"711f44d8d4af51538ff1764145ac743445b6f43b","user":{"login":"lewismc","id":1165719,"avatar_url":"https://avatars.githubusercontent.com/u/1165719?v=3","gravatar_id":"","url":"https://api.github.com/users/lewismc","html_url":"https://github.com/lewismc","followers_url":"https://api.github.com/users/lewismc/followers","following_url":"https://api.github.com/users/lewismc/following{/other_user}","gists_url":"https://api.github.com/users/lewismc/gists{/gist_id}","starred_url":"https://api.github.com/users/lewismc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewismc/subscriptions","organizations_url":"https://api.github.com/users/lewismc/orgs","repos_url":"https://api.github.com/users/lewismc/repos","events_url":"https://api.github.com/users/lewismc/events{/privacy}","received_events_url":"https://api.github.com/users/lewismc/received_events","type":"User","site_admin":false},"body":"This class and all of it;s methods need to be documented. No-one will know what is going on here.","created_at":"2015-06-18T06:49:10Z","updated_at":"2015-06-18T06:49:10Z","html_url":"https://github.com/apache/nutch/pull/32#discussion_r32702813","pull_request_url":"https://api.github.com/repos/apache/nutch/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/apache/nutch/pulls/comments/32702813"},"html":{"href":"https://github.com/apache/nutch/pull/32#discussion_r32702813"},"pull_request":{"href":"https://api.github.com/repos/apache/nutch/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/apache/nutch/pulls/32","id":37975282,"html_url":"https://github.com/apache/nutch/pull/32","diff_url":"https://github.com/apache/nutch/pull/32.diff","patch_url":"https://github.com/apache/nutch/pull/32.patch","issue_url":"https://api.github.com/repos/apache/nutch/issues/32","number":32,"state":"open","locked":false,"title":"Nutch 2038","user":{"login":"asitang","id":8554420,"avatar_url":"https://avatars.githubusercontent.com/u/8554420?v=3","gravatar_id":"","url":"https://api.github.com/users/asitang","html_url":"https://github.com/asitang","followers_url":"https://api.github.com/users/asitang/followers","following_url":"https://api.github.com/users/asitang/following{/other_user}","gists_url":"https://api.github.com/users/asitang/gists{/gist_id}","starred_url":"https://api.github.com/users/asitang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asitang/subscriptions","organizations_url":"https://api.github.com/users/asitang/orgs","repos_url":"https://api.github.com/users/asitang/repos","events_url":"https://api.github.com/users/asitang/events{/privacy}","received_events_url":"https://api.github.com/users/asitang/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-18T06:32:56Z","updated_at":"2015-06-18T06:49:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30c6c1d7485c47597379d6506a07b5cd869e2359","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/nutch/pulls/32/commits","review_comments_url":"https://api.github.com/repos/apache/nutch/pulls/32/comments","review_comment_url":"https://api.github.com/repos/apache/nutch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/nutch/issues/32/comments","statuses_url":"https://api.github.com/repos/apache/nutch/statuses/711f44d8d4af51538ff1764145ac743445b6f43b","head":{"label":"asitang:NUTCH-2038","ref":"NUTCH-2038","sha":"711f44d8d4af51538ff1764145ac743445b6f43b","user":{"login":"asitang","id":8554420,"avatar_url":"https://avatars.githubusercontent.com/u/8554420?v=3","gravatar_id":"","url":"https://api.github.com/users/asitang","html_url":"https://github.com/asitang","followers_url":"https://api.github.com/users/asitang/followers","following_url":"https://api.github.com/users/asitang/following{/other_user}","gists_url":"https://api.github.com/users/asitang/gists{/gist_id}","starred_url":"https://api.github.com/users/asitang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asitang/subscriptions","organizations_url":"https://api.github.com/users/asitang/orgs","repos_url":"https://api.github.com/users/asitang/repos","events_url":"https://api.github.com/users/asitang/events{/privacy}","received_events_url":"https://api.github.com/users/asitang/received_events","type":"User","site_admin":false},"repo":{"id":37560980,"name":"nutch","full_name":"asitang/nutch","owner":{"login":"asitang","id":8554420,"avatar_url":"https://avatars.githubusercontent.com/u/8554420?v=3","gravatar_id":"","url":"https://api.github.com/users/asitang","html_url":"https://github.com/asitang","followers_url":"https://api.github.com/users/asitang/followers","following_url":"https://api.github.com/users/asitang/following{/other_user}","gists_url":"https://api.github.com/users/asitang/gists{/gist_id}","starred_url":"https://api.github.com/users/asitang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asitang/subscriptions","organizations_url":"https://api.github.com/users/asitang/orgs","repos_url":"https://api.github.com/users/asitang/repos","events_url":"https://api.github.com/users/asitang/events{/privacy}","received_events_url":"https://api.github.com/users/asitang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asitang/nutch","description":"Mirror of Apache Nutch","fork":true,"url":"https://api.github.com/repos/asitang/nutch","forks_url":"https://api.github.com/repos/asitang/nutch/forks","keys_url":"https://api.github.com/repos/asitang/nutch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asitang/nutch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asitang/nutch/teams","hooks_url":"https://api.github.com/repos/asitang/nutch/hooks","issue_events_url":"https://api.github.com/repos/asitang/nutch/issues/events{/number}","events_url":"https://api.github.com/repos/asitang/nutch/events","assignees_url":"https://api.github.com/repos/asitang/nutch/assignees{/user}","branches_url":"https://api.github.com/repos/asitang/nutch/branches{/branch}","tags_url":"https://api.github.com/repos/asitang/nutch/tags","blobs_url":"https://api.github.com/repos/asitang/nutch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asitang/nutch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asitang/nutch/git/refs{/sha}","trees_url":"https://api.github.com/repos/asitang/nutch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asitang/nutch/statuses/{sha}","languages_url":"https://api.github.com/repos/asitang/nutch/languages","stargazers_url":"https://api.github.com/repos/asitang/nutch/stargazers","contributors_url":"https://api.github.com/repos/asitang/nutch/contributors","subscribers_url":"https://api.github.com/repos/asitang/nutch/subscribers","subscription_url":"https://api.github.com/repos/asitang/nutch/subscription","commits_url":"https://api.github.com/repos/asitang/nutch/commits{/sha}","git_commits_url":"https://api.github.com/repos/asitang/nutch/git/commits{/sha}","comments_url":"https://api.github.com/repos/asitang/nutch/comments{/number}","issue_comment_url":"https://api.github.com/repos/asitang/nutch/issues/comments{/number}","contents_url":"https://api.github.com/repos/asitang/nutch/contents/{+path}","compare_url":"https://api.github.com/repos/asitang/nutch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asitang/nutch/merges","archive_url":"https://api.github.com/repos/asitang/nutch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asitang/nutch/downloads","issues_url":"https://api.github.com/repos/asitang/nutch/issues{/number}","pulls_url":"https://api.github.com/repos/asitang/nutch/pulls{/number}","milestones_url":"https://api.github.com/repos/asitang/nutch/milestones{/number}","notifications_url":"https://api.github.com/repos/asitang/nutch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asitang/nutch/labels{/name}","releases_url":"https://api.github.com/repos/asitang/nutch/releases{/id}","created_at":"2015-06-16T23:15:56Z","updated_at":"2015-06-16T23:15:59Z","pushed_at":"2015-06-17T16:35:38Z","git_url":"git://github.com/asitang/nutch.git","ssh_url":"git@github.com:asitang/nutch.git","clone_url":"https://github.com/asitang/nutch.git","svn_url":"https://github.com/asitang/nutch","homepage":null,"size":132058,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"b754b90761743e07cd63dd9e8d8713e631d08371","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":206370,"name":"nutch","full_name":"apache/nutch","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/nutch","description":"Mirror of Apache Nutch","fork":false,"url":"https://api.github.com/repos/apache/nutch","forks_url":"https://api.github.com/repos/apache/nutch/forks","keys_url":"https://api.github.com/repos/apache/nutch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/nutch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/nutch/teams","hooks_url":"https://api.github.com/repos/apache/nutch/hooks","issue_events_url":"https://api.github.com/repos/apache/nutch/issues/events{/number}","events_url":"https://api.github.com/repos/apache/nutch/events","assignees_url":"https://api.github.com/repos/apache/nutch/assignees{/user}","branches_url":"https://api.github.com/repos/apache/nutch/branches{/branch}","tags_url":"https://api.github.com/repos/apache/nutch/tags","blobs_url":"https://api.github.com/repos/apache/nutch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/nutch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/nutch/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/nutch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/nutch/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/nutch/languages","stargazers_url":"https://api.github.com/repos/apache/nutch/stargazers","contributors_url":"https://api.github.com/repos/apache/nutch/contributors","subscribers_url":"https://api.github.com/repos/apache/nutch/subscribers","subscription_url":"https://api.github.com/repos/apache/nutch/subscription","commits_url":"https://api.github.com/repos/apache/nutch/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/nutch/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/nutch/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/nutch/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/nutch/contents/{+path}","compare_url":"https://api.github.com/repos/apache/nutch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/nutch/merges","archive_url":"https://api.github.com/repos/apache/nutch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/nutch/downloads","issues_url":"https://api.github.com/repos/apache/nutch/issues{/number}","pulls_url":"https://api.github.com/repos/apache/nutch/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/nutch/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/nutch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/nutch/labels{/name}","releases_url":"https://api.github.com/repos/apache/nutch/releases{/id}","created_at":"2009-05-21T01:17:48Z","updated_at":"2015-06-17T13:52:33Z","pushed_at":"2015-06-18T06:32:57Z","git_url":"git://github.com/apache/nutch.git","ssh_url":"git@github.com:apache/nutch.git","clone_url":"https://github.com/apache/nutch.git","svn_url":"https://github.com/apache/nutch","homepage":null,"size":132058,"stargazers_count":349,"watchers_count":349,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":298,"mirror_url":"git://git.apache.org/nutch.git","open_issues_count":2,"forks":298,"open_issues":2,"watchers":349,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/nutch/pulls/32"},"html":{"href":"https://github.com/apache/nutch/pull/32"},"issue":{"href":"https://api.github.com/repos/apache/nutch/issues/32"},"comments":{"href":"https://api.github.com/repos/apache/nutch/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/nutch/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/nutch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/nutch/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/apache/nutch/statuses/711f44d8d4af51538ff1764145ac743445b6f43b"}}}}