nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chrismattmann <...@git.apache.org>
Subject [GitHub] nutch pull request: fix for NUTCH-2039 contributed by Sujen Shah
Date Mon, 15 Jun 2015 12:19:21 GMT
Github user chrismattmann commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/30#discussion_r32413625
  
    --- Diff: src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/SimilarityScoringFilter.java
---
    @@ -0,0 +1,150 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nutch.scoring.similarity;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.util.Collection;
    +import java.util.List;
    +import java.util.Map.Entry;
    +
    +import org.apache.commons.io.FileUtils;
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.io.Text;
    +import org.apache.nutch.crawl.CrawlDatum;
    +import org.apache.nutch.crawl.Inlinks;
    +import org.apache.nutch.indexer.NutchDocument;
    +import org.apache.nutch.metadata.Nutch;
    +import org.apache.nutch.parse.Parse;
    +import org.apache.nutch.parse.ParseData;
    +import org.apache.nutch.protocol.Content;
    +import org.apache.nutch.scoring.ScoringFilter;
    +import org.apache.nutch.scoring.ScoringFilterException;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +public class SimilarityScoringFilter implements ScoringFilter {
    +
    +  private Configuration conf;
    +  private String goldStandardDocPath;
    +  private final static Logger LOG = LoggerFactory
    +      .getLogger(SimilarityScoringFilter.class);
    +  
    +  @Override
    +  public Configuration getConf() {
    +    return conf;
    +  }
    +
    +  @Override
    +  public void setConf(Configuration conf) {
    +    this.conf = conf;
    +    goldStandardDocPath = conf.get("similarity.model.path");
    +    LOG.info("Getting the goldstanrd path {}",goldStandardDocPath);
    +  }
    +
    +  @Override
    +  public void injectedScore(Text url, CrawlDatum datum)
    +      throws ScoringFilterException {
    +    // TODO Auto-generated method stub
    +
    +  }
    +
    +  @Override
    +  public void initialScore(Text url, CrawlDatum datum)
    --- End diff --
    
    I think in these cases, you should simply call Tika on the URL.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message