Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-758 Set subversion eol-style to "native".

Andrzej Bialecki1701697cf948
diff --git a/CHANGES.txt b/CHANGES.txt
index e4aecd12b..586bd2538 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -28,6 +28,8 @@ Unreleased Changes
* NUTCH-679 - Fetcher2 implementing Tool (Julien Nioche via ab)
+* NUTCH-758 - Set subversion eol-style to "native" (Niall Pemberton via ab)
+
Release 1.0 - 2009-03-23
1. NUTCH-474 - Fetcher2 crawlDelay and blocking fix (Dogacan Guney via ab)
diff --git a/src/java/org/apache/nutch/clustering/HitsCluster.java b/src/java/org/apache/nutch/clustering/HitsCluster.java
index a8e1228df..93277c59f 100644
--- a/src/java/org/apache/nutch/clustering/HitsCluster.java
+++ b/src/java/org/apache/nutch/clustering/HitsCluster.java
@@ -29,7 +29,7 @@ import org.apache.nutch.searcher.HitDetails;
* see an explicit group of documents that didn't belong anywhere else.</p>
*
* @author Dawid Weiss
- * @version $Id: HitsCluster.java,v 1.1 2004/08/09 23:23:52 johnnx Exp $
+ * @version $Id$
*/
public interface HitsCluster {
/**
diff --git a/src/java/org/apache/nutch/clustering/OnlineClusterer.java b/src/java/org/apache/nutch/clustering/OnlineClusterer.java
index fa44c397e..964f79f1b 100644
--- a/src/java/org/apache/nutch/clustering/OnlineClusterer.java
+++ b/src/java/org/apache/nutch/clustering/OnlineClusterer.java
@@ -35,7 +35,7 @@ import org.apache.nutch.searcher.HitDetails;
* preclustered groups, but I do not investigate those any further here.</p>
*
* @author Dawid Weiss
- * @version $Id: OnlineClusterer.java,v 1.1 2004/08/09 23:23:52 johnnx Exp $
+ * @version $Id$
*/
public interface OnlineClusterer extends Pluggable {
/** The name of the extension point. */
diff --git a/src/java/org/apache/nutch/clustering/OnlineClustererFactory.java b/src/java/org/apache/nutch/clustering/OnlineClustererFactory.java
index 4a54486b7..26d2bdf85 100644
--- a/src/java/org/apache/nutch/clustering/OnlineClustererFactory.java
+++ b/src/java/org/apache/nutch/clustering/OnlineClustererFactory.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration;
* A factory for retrieving {@link OnlineClusterer} extensions.
*
* @author Dawid Weiss
- * @version $Id: OnlineClustererFactory.java,v 1.2 2005/02/07 19:09:26 cutting Exp $
+ * @version $Id$
*/
public class OnlineClustererFactory {
public static final Log LOG = LogFactory.getLog(OnlineClustererFactory.class);
diff --git a/src/java/org/apache/nutch/ontology/OntologyFactory.java b/src/java/org/apache/nutch/ontology/OntologyFactory.java
index 8813a0e9a..6e40398d9 100644
--- a/src/java/org/apache/nutch/ontology/OntologyFactory.java
+++ b/src/java/org/apache/nutch/ontology/OntologyFactory.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration;
* A factory for retrieving {@link Ontology} extensions.
*
* @author Michael Pan
- * @version $Id: OntologyFactory.java,v 1.2 2005/02/07 19:09:58 cutting Exp $
+ * @version $Id$
*/
public class OntologyFactory {
public final static Log LOG = LogFactory.getLog(OntologyFactory.class);
diff --git a/src/java/org/apache/nutch/searcher/NutchBean.java b/src/java/org/apache/nutch/searcher/NutchBean.java
index 452088bcc..a2dc36d0f 100644
--- a/src/java/org/apache/nutch/searcher/NutchBean.java
+++ b/src/java/org/apache/nutch/searcher/NutchBean.java
@@ -36,7 +36,7 @@ import org.apache.nutch.util.NutchConfiguration;
/**
* One stop shopping for search-related functionality.
- * @version $Id: NutchBean.java,v 1.19 2005/02/07 19:10:08 cutting Exp $
+ * @version $Id$
*/
public class NutchBean
implements SearchBean, SegmentBean, HitInlinks, Closeable {
diff --git a/src/plugin/clustering-carrot2/plugin.xml b/src/plugin/clustering-carrot2/plugin.xml
index 919d41c38..33001f76c 100644
--- a/src/plugin/clustering-carrot2/plugin.xml
+++ b/src/plugin/clustering-carrot2/plugin.xml
@@ -1,56 +1,56 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<plugin
- id="clustering-carrot2"
- name="Online Search Results Clustering using Carrot2's components"
- version="1.0.3"
- provider-name="www.carrot2.org">
-
- <runtime>
- <library name="clustering-carrot2.jar">
- <export name="*"/>
- </library>
-
- <!--
- The defaults for Lingo. If you plan to use another clustering
- algorithm from the Carrot2 project, you'll need all the JARs
- required for that algorithm.
- -->
- <library name="carrot2-filter-lingo.jar"/>
- <library name="carrot2-local-core.jar"/>
- <library name="carrot2-snowball-stemmers.jar"/>
- <library name="carrot2-util-common.jar"/>
- <library name="carrot2-util-tokenizer.jar"/>
-
- <library name="commons-collections-3.2.jar"/>
- <library name="commons-pool-1.3.jar"/>
- <library name="Jama-1.0.2.jar"/>
- <library name="violinstrings-1.0.2.jar"/>
- </runtime>
-
- <requires>
- <import plugin="nutch-extensionpoints"/>
- </requires>
-
- <extension id="org.apache.nutch.clustering.carrot2"
- name="Carrot2 Clusterer"
- point="org.apache.nutch.clustering.OnlineClusterer">
- <implementation id="Carrot2"
- class="org.apache.nutch.clustering.carrot2.Clusterer"/>
- </extension>
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<plugin
+ id="clustering-carrot2"
+ name="Online Search Results Clustering using Carrot2's components"
+ version="1.0.3"
+ provider-name="www.carrot2.org">
+
+ <runtime>
+ <library name="clustering-carrot2.jar">
+ <export name="*"/>
+ </library>
+
+ <!--
+ The defaults for Lingo. If you plan to use another clustering
+ algorithm from the Carrot2 project, you'll need all the JARs
+ required for that algorithm.
+ -->
+ <library name="carrot2-filter-lingo.jar"/>
+ <library name="carrot2-local-core.jar"/>
+ <library name="carrot2-snowball-stemmers.jar"/>
+ <library name="carrot2-util-common.jar"/>
+ <library name="carrot2-util-tokenizer.jar"/>
+
+ <library name="commons-collections-3.2.jar"/>
+ <library name="commons-pool-1.3.jar"/>
+ <library name="Jama-1.0.2.jar"/>
+ <library name="violinstrings-1.0.2.jar"/>
+ </runtime>
+
+ <requires>
+ <import plugin="nutch-extensionpoints"/>
+ </requires>
+
+ <extension id="org.apache.nutch.clustering.carrot2"
+ name="Carrot2 Clusterer"
+ point="org.apache.nutch.clustering.OnlineClusterer">
+ <implementation id="Carrot2"
+ class="org.apache.nutch.clustering.carrot2.Clusterer"/>
+ </extension>
+</plugin>
diff --git a/src/plugin/clustering-carrot2/readme.txt b/src/plugin/clustering-carrot2/readme.txt
index c58574c04..b6dafffe9 100644
--- a/src/plugin/clustering-carrot2/readme.txt
+++ b/src/plugin/clustering-carrot2/readme.txt
@@ -1,7 +1,7 @@
-This plugin extension adds search results clustering capability to Nutch search
-frontend.
-
-Carrot2 JARs come from codebase in version: 2.1
-
-See the WIKI for more information about configuration and installation
-of this plugin.
+This plugin extension adds search results clustering capability to Nutch search
+frontend.
+
+Carrot2 JARs come from codebase in version: 2.1
+
+See the WIKI for more information about configuration and installation
+of this plugin.
diff --git a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/Clusterer.java b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/Clusterer.java
index b96576108..abdb044b7 100644
--- a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/Clusterer.java
+++ b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/Clusterer.java
@@ -1,330 +1,330 @@
-/**
- * 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.clustering.carrot2;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configurable;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.nutch.clustering.HitsCluster;
-import org.apache.nutch.clustering.OnlineClusterer;
-import org.apache.nutch.searcher.HitDetails;
-import org.carrot2.core.DuplicatedKeyException;
-import org.carrot2.core.InitializationException;
-import org.carrot2.core.LocalComponent;
-import org.carrot2.core.LocalComponentFactory;
-import org.carrot2.core.LocalControllerBase;
-import org.carrot2.core.LocalProcess;
-import org.carrot2.core.LocalProcessBase;
-import org.carrot2.core.MissingComponentException;
-import org.carrot2.core.MissingProcessException;
-import org.carrot2.core.ProcessingResult;
-import org.carrot2.core.clustering.RawCluster;
-import org.carrot2.core.controller.ControllerHelper;
-import org.carrot2.core.controller.LoaderExtensionUnknownException;
-import org.carrot2.core.impl.ArrayOutputComponent;
-import org.carrot2.core.linguistic.Language;
-import org.carrot2.filter.lingo.local.LingoLocalFilterComponent;
-import org.carrot2.util.tokenizer.languages.AllKnownLanguages;
-
-
-
-/**
- * This plugin provides an implementation of {@link OnlineClusterer}
- * extension using clustering components of the Carrot2 project
- * (<a href="http://www.carrot2.org">http://www.carrot2.org</a>).
- *
- * <p>This class hardcodes an equivalent of the following Carrot2 process:
- * <pre><![CDATA[
- * <local-process id="yahoo-lingo">
- * <name>Yahoo Search API -- Lingo Classic Clusterer</name>
- *
- * <input component-key="input-nutch" />
- * <filter component-key="filter-lingo" />
- * <output component-key="output-clustersConsumer" />
- * </local-process>
- * ]]></pre>
- */
-public class Clusterer implements OnlineClusterer, Configurable {
- /** Default language property name. */
- private final static String CONF_PROP_DEFAULT_LANGUAGE =
- "extension.clustering.carrot2.defaultLanguage";
-
- /** Recognizable languages property name. */
- private final static String CONF_PROP_LANGUAGES =
- "extension.clustering.carrot2.languages";
-
- /** Internal clustering process ID in Carrot2 LocalController */
- private final static String PROCESS_ID = "nutch-lingo";
-
- public static final Log logger = LogFactory.getLog(Clusterer.class);
-
- /** The LocalController instance used for clustering */
- private LocalControllerBase controller;
-
- /** Nutch configuration. */
- private Configuration conf;
-
- /**
- * Default language for hits. English by default, but may be changed
- * via a property in Nutch configuration.
- */
- private String defaultLanguage = "en";
-
- /**
- * A list of recognizable languages..
- * English only by default, but configurable via Nutch configuration.
- */
- private String [] languages = new String [] {defaultLanguage};
-
- /**
- * An empty public constructor for making new instances
- * of the clusterer.
- */
- public Clusterer() {
- // Don't forget to call {@link #setConf(Configuration)}.
- }
-
- /**
- * See {@link OnlineClusterer} for documentation.
- */
- public HitsCluster [] clusterHits(HitDetails [] hitDetails, String [] descriptions) {
- if (this.controller == null) {
- logger.error("initialize() not called.");
- return new HitsCluster[0];
- }
-
- final Map requestParams = new HashMap();
- requestParams.put(NutchInputComponent.NUTCH_INPUT_HIT_DETAILS_ARRAY,
- hitDetails);
- requestParams.put(NutchInputComponent.NUTCH_INPUT_SUMMARIES_ARRAY,
- descriptions);
-
- try {
- // The input component takes Nutch's results so we don't need the query argument.
- final ProcessingResult result =
- controller.query(PROCESS_ID, "no-query", requestParams);
-
- final ArrayOutputComponent.Result output =
- (ArrayOutputComponent.Result) result.getQueryResult();
-
- final List outputClusters = output.clusters;
- final HitsCluster [] clusters = new HitsCluster[ outputClusters.size() ];
-
- int j = 0;
- for (Iterator i = outputClusters.iterator(); i.hasNext(); j++) {
- RawCluster rcluster = (RawCluster) i.next();
- clusters[j] = new HitsClusterAdapter(rcluster, hitDetails);
- }
-
- // invoke Carrot2 process here.
- return clusters;
- } catch (MissingProcessException e) {
- throw new RuntimeException("Missing clustering process.", e);
- } catch (Exception e) {
- throw new RuntimeException("Unidentified problems with the clustering.", e);
- }
- }
-
- /**
- * Implementation of {@link Configurable}
- */
- public void setConf(Configuration conf) {
- this.conf = conf;
-
- // Configure default language and other component settings.
- if (conf.get(CONF_PROP_DEFAULT_LANGUAGE) != null) {
- // Change the default language.
- this.defaultLanguage = conf.get(CONF_PROP_DEFAULT_LANGUAGE);
- }
- if (conf.getStrings(CONF_PROP_LANGUAGES) != null) {
- this.languages = conf.getStrings(CONF_PROP_LANGUAGES);
- }
-
- if (logger.isInfoEnabled()) {
- logger.info("Default language: " + defaultLanguage);
- logger.info("Enabled languages: " + Arrays.asList(languages));
- }
-
- initialize();
- }
-
- /**
- * Implementation of {@link Configurable}
- */
- public Configuration getConf() {
- return conf;
- }
-
- /**
- * Initialize clustering processes and Carrot2 components.
- */
- private synchronized void initialize() {
- // Initialize language list, temporarily switching off logging
- // of warnings. This is a bit of a hack, but we don't want to
- // redistribute the entire Carrot2 distro and this prevents
- // nasty ClassNotFound warnings.
- final Logger c2Logger = Logger.getLogger("org.carrot2");
- final Level original = c2Logger.getLevel();
- c2Logger.setLevel(Level.ERROR);
- AllKnownLanguages.getLanguageCodes();
- c2Logger.setLevel(original);
-
- // Initialize the controller.
- controller = new LocalControllerBase();
-
- final Configuration nutchConf = getConf();
- final String processResource = nutchConf.get(
- "extension.clustering.carrot2.process-resource");
-
- if (processResource == null) {
- logger.info("Using default clustering algorithm (Lingo).");
- addDefaultProcess();
- } else {
- logger.info("Using custom clustering process: " + processResource);
- controller.setComponentAutoload(true);
-
- final ControllerHelper helper = new ControllerHelper();
- final InputStream is = Thread.currentThread()
- .getContextClassLoader().getResourceAsStream(processResource);
- if (is != null) {
- try {
- final LocalComponentFactory nutchInputFactory = new LocalComponentFactory() {
- public LocalComponent getInstance() {
- return new NutchInputComponent(defaultLanguage);
- }
- };
- controller.addLocalComponentFactory("input-nutch", nutchInputFactory);
-
- final LocalProcess process = helper.loadProcess(
- helper.getExtension(processResource), is).getProcess();
- controller.addProcess(PROCESS_ID, process);
- is.close();
- } catch (IOException e) {
- logger.error("Could not load process resource: " + processResource, e);
- } catch (LoaderExtensionUnknownException e) {
- logger.error("Unrecognized extension of process resource: " + processResource);
- } catch (InstantiationException e) {
- logger.error("Could not instantiate process: " + processResource, e);
- } catch (InitializationException e) {
- logger.error("Could not initialize process: " + processResource, e);
- } catch (DuplicatedKeyException e) {
- logger.error("Duplicated key (unreachable?): " + processResource, e);
- } catch (MissingComponentException e) {
- logger.error("Some components are missing, could not initialize process: "
- + processResource, e);
- }
- } else {
- logger.error("Could not find process resource: " + processResource);
- }
- }
- }
-
- /**
- * Adds a default clustering process using Lingo algorithm.
- */
- private void addDefaultProcess() {
- try {
- addComponentFactories();
- addProcesses();
- } catch (DuplicatedKeyException e) {
- logger.fatal("Duplicated component or process identifier.", e);
- }
- }
-
- /** Adds the required component factories to a local Carrot2 controller. */
- private void addComponentFactories() throws DuplicatedKeyException {
- // * <input component-key="input-nutch" />
- LocalComponentFactory nutchInputFactory = new LocalComponentFactory() {
- public LocalComponent getInstance() {
- return new NutchInputComponent(defaultLanguage);
- }
- };
- controller.addLocalComponentFactory("input-nutch", nutchInputFactory);
-
- // * <filter component-key="filter-lingo" />
- LocalComponentFactory lingoFactory = new LocalComponentFactory() {
- public LocalComponent getInstance() {
- final HashMap defaults = new HashMap();
-
- // These are adjustments settings for the clustering algorithm.
- // If you try the live WebStart demo of Carrot2 you can see how they affect
- // the final clustering: http://www.carrot2.org
- defaults.put("lsi.threshold.clusterAssignment", "0.150");
- defaults.put("lsi.threshold.candidateCluster", "0.775");
-
- // Initialize a new Lingo clustering component.
- ArrayList languageList = new ArrayList(languages.length);
- for (int i = 0; i < languages.length; i++) {
- final String lcode = languages[i];
- try {
- final Language lang = AllKnownLanguages.getLanguageForIsoCode(lcode);
- if (lang == null) {
- logger.warn("Language not supported in Carrot2: " + lcode);
- } else {
- languageList.add(lang);
- logger.debug("Language loaded: " + lcode);
- }
- } catch (Throwable t) {
- logger.warn("Language could not be loaded: " + lcode, t);
- }
- }
- return new LingoLocalFilterComponent(
- (Language []) languageList.toArray(new Language [languageList.size()]), defaults);
- }
- };
- controller.addLocalComponentFactory("filter-lingo", lingoFactory);
-
- // * <output component-key="output-clustersConsumer" />
- LocalComponentFactory clusterConsumerOutputFactory = new LocalComponentFactory() {
- public LocalComponent getInstance() {
- return new ArrayOutputComponent();
- }
- };
- controller.addLocalComponentFactory("output-array",
- clusterConsumerOutputFactory);
- }
-
- /**
- * Adds a hardcoded clustering process to the local controller.
- */
- private void addProcesses() {
- final LocalProcessBase process = new LocalProcessBase(
- "input-nutch",
- "output-array",
- new String [] {"filter-lingo"},
- "The Lingo clustering algorithm (www.carrot2.org).",
- "");
-
- try {
- controller.addProcess(PROCESS_ID, process);
- } catch (Exception e) {
- throw new RuntimeException("Could not assemble clustering process.", e);
- }
- }
-}
+/**
+ * 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.clustering.carrot2;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.nutch.clustering.HitsCluster;
+import org.apache.nutch.clustering.OnlineClusterer;
+import org.apache.nutch.searcher.HitDetails;
+import org.carrot2.core.DuplicatedKeyException;
+import org.carrot2.core.InitializationException;
+import org.carrot2.core.LocalComponent;
+import org.carrot2.core.LocalComponentFactory;
+import org.carrot2.core.LocalControllerBase;
+import org.carrot2.core.LocalProcess;
+import org.carrot2.core.LocalProcessBase;
+import org.carrot2.core.MissingComponentException;
+import org.carrot2.core.MissingProcessException;
+import org.carrot2.core.ProcessingResult;
+import org.carrot2.core.clustering.RawCluster;
+import org.carrot2.core.controller.ControllerHelper;
+import org.carrot2.core.controller.LoaderExtensionUnknownException;
+import org.carrot2.core.impl.ArrayOutputComponent;
+import org.carrot2.core.linguistic.Language;
+import org.carrot2.filter.lingo.local.LingoLocalFilterComponent;
+import org.carrot2.util.tokenizer.languages.AllKnownLanguages;
+
+
+
+/**
+ * This plugin provides an implementation of {@link OnlineClusterer}
+ * extension using clustering components of the Carrot2 project
+ * (<a href="http://www.carrot2.org">http://www.carrot2.org</a>).
+ *
+ * <p>This class hardcodes an equivalent of the following Carrot2 process:
+ * <pre><![CDATA[
+ * <local-process id="yahoo-lingo">
+ * <name>Yahoo Search API -- Lingo Classic Clusterer</name>
+ *
+ * <input component-key="input-nutch" />
+ * <filter component-key="filter-lingo" />
+ * <output component-key="output-clustersConsumer" />
+ * </local-process>
+ * ]]></pre>
+ */
+public class Clusterer implements OnlineClusterer, Configurable {
+ /** Default language property name. */
+ private final static String CONF_PROP_DEFAULT_LANGUAGE =
+ "extension.clustering.carrot2.defaultLanguage";
+
+ /** Recognizable languages property name. */
+ private final static String CONF_PROP_LANGUAGES =
+ "extension.clustering.carrot2.languages";
+
+ /** Internal clustering process ID in Carrot2 LocalController */
+ private final static String PROCESS_ID = "nutch-lingo";
+
+ public static final Log logger = LogFactory.getLog(Clusterer.class);
+
+ /** The LocalController instance used for clustering */
+ private LocalControllerBase controller;
+
+ /** Nutch configuration. */
+ private Configuration conf;
+
+ /**
+ * Default language for hits. English by default, but may be changed
+ * via a property in Nutch configuration.
+ */
+ private String defaultLanguage = "en";
+
+ /**
+ * A list of recognizable languages..
+ * English only by default, but configurable via Nutch configuration.
+ */
+ private String [] languages = new String [] {defaultLanguage};
+
+ /**
+ * An empty public constructor for making new instances
+ * of the clusterer.
+ */
+ public Clusterer() {
+ // Don't forget to call {@link #setConf(Configuration)}.
+ }
+
+ /**
+ * See {@link OnlineClusterer} for documentation.
+ */
+ public HitsCluster [] clusterHits(HitDetails [] hitDetails, String [] descriptions) {
+ if (this.controller == null) {
+ logger.error("initialize() not called.");
+ return new HitsCluster[0];
+ }
+
+ final Map requestParams = new HashMap();
+ requestParams.put(NutchInputComponent.NUTCH_INPUT_HIT_DETAILS_ARRAY,
+ hitDetails);
+ requestParams.put(NutchInputComponent.NUTCH_INPUT_SUMMARIES_ARRAY,
+ descriptions);
+
+ try {
+ // The input component takes Nutch's results so we don't need the query argument.
+ final ProcessingResult result =
+ controller.query(PROCESS_ID, "no-query", requestParams);
+
+ final ArrayOutputComponent.Result output =
+ (ArrayOutputComponent.Result) result.getQueryResult();
+
+ final List outputClusters = output.clusters;
+ final HitsCluster [] clusters = new HitsCluster[ outputClusters.size() ];
+
+ int j = 0;
+ for (Iterator i = outputClusters.iterator(); i.hasNext(); j++) {
+ RawCluster rcluster = (RawCluster) i.next();
+ clusters[j] = new HitsClusterAdapter(rcluster, hitDetails);
+ }
+
+ // invoke Carrot2 process here.
+ return clusters;
+ } catch (MissingProcessException e) {
+ throw new RuntimeException("Missing clustering process.", e);
+ } catch (Exception e) {
+ throw new RuntimeException("Unidentified problems with the clustering.", e);
+ }
+ }
+
+ /**
+ * Implementation of {@link Configurable}
+ */
+ public void setConf(Configuration conf) {
+ this.conf = conf;
+
+ // Configure default language and other component settings.
+ if (conf.get(CONF_PROP_DEFAULT_LANGUAGE) != null) {
+ // Change the default language.
+ this.defaultLanguage = conf.get(CONF_PROP_DEFAULT_LANGUAGE);
+ }
+ if (conf.getStrings(CONF_PROP_LANGUAGES) != null) {
+ this.languages = conf.getStrings(CONF_PROP_LANGUAGES);
+ }
+
+ if (logger.isInfoEnabled()) {
+ logger.info("Default language: " + defaultLanguage);
+ logger.info("Enabled languages: " + Arrays.asList(languages));
+ }
+
+ initialize();
+ }
+
+ /**
+ * Implementation of {@link Configurable}
+ */
+ public Configuration getConf() {
+ return conf;
+ }
+
+ /**
+ * Initialize clustering processes and Carrot2 components.
+ */
+ private synchronized void initialize() {
+ // Initialize language list, temporarily switching off logging
+ // of warnings. This is a bit of a hack, but we don't want to
+ // redistribute the entire Carrot2 distro and this prevents
+ // nasty ClassNotFound warnings.
+ final Logger c2Logger = Logger.getLogger("org.carrot2");
+ final Level original = c2Logger.getLevel();
+ c2Logger.setLevel(Level.ERROR);
+ AllKnownLanguages.getLanguageCodes();
+ c2Logger.setLevel(original);
+
+ // Initialize the controller.
+ controller = new LocalControllerBase();
+
+ final Configuration nutchConf = getConf();
+ final String processResource = nutchConf.get(
+ "extension.clustering.carrot2.process-resource");
+
+ if (processResource == null) {
+ logger.info("Using default clustering algorithm (Lingo).");
+ addDefaultProcess();
+ } else {
+ logger.info("Using custom clustering process: " + processResource);
+ controller.setComponentAutoload(true);
+
+ final ControllerHelper helper = new ControllerHelper();
+ final InputStream is = Thread.currentThread()
+ .getContextClassLoader().getResourceAsStream(processResource);
+ if (is != null) {
+ try {
+ final LocalComponentFactory nutchInputFactory = new LocalComponentFactory() {
+ public LocalComponent getInstance() {
+ return new NutchInputComponent(defaultLanguage);
+ }
+ };
+ controller.addLocalComponentFactory("input-nutch", nutchInputFactory);
+
+ final LocalProcess process = helper.loadProcess(
+ helper.getExtension(processResource), is).getProcess();
+ controller.addProcess(PROCESS_ID, process);
+ is.close();
+ } catch (IOException e) {
+ logger.error("Could not load process resource: " + processResource, e);
+ } catch (LoaderExtensionUnknownException e) {
+ logger.error("Unrecognized extension of process resource: " + processResource);
+ } catch (InstantiationException e) {
+ logger.error("Could not instantiate process: " + processResource, e);
+ } catch (InitializationException e) {
+ logger.error("Could not initialize process: " + processResource, e);
+ } catch (DuplicatedKeyException e) {
+ logger.error("Duplicated key (unreachable?): " + processResource, e);
+ } catch (MissingComponentException e) {
+ logger.error("Some components are missing, could not initialize process: "
+ + processResource, e);
+ }
+ } else {
+ logger.error("Could not find process resource: " + processResource);
+ }
+ }
+ }
+
+ /**
+ * Adds a default clustering process using Lingo algorithm.
+ */
+ private void addDefaultProcess() {
+ try {
+ addComponentFactories();
+ addProcesses();
+ } catch (DuplicatedKeyException e) {
+ logger.fatal("Duplicated component or process identifier.", e);
+ }
+ }
+
+ /** Adds the required component factories to a local Carrot2 controller. */
+ private void addComponentFactories() throws DuplicatedKeyException {
+ // * <input component-key="input-nutch" />
+ LocalComponentFactory nutchInputFactory = new LocalComponentFactory() {
+ public LocalComponent getInstance() {
+ return new NutchInputComponent(defaultLanguage);
+ }
+ };
+ controller.addLocalComponentFactory("input-nutch", nutchInputFactory);
+
+ // * <filter component-key="filter-lingo" />
+ LocalComponentFactory lingoFactory = new LocalComponentFactory() {
+ public LocalComponent getInstance() {
+ final HashMap defaults = new HashMap();
+
+ // These are adjustments settings for the clustering algorithm.
+ // If you try the live WebStart demo of Carrot2 you can see how they affect
+ // the final clustering: http://www.carrot2.org
+ defaults.put("lsi.threshold.clusterAssignment", "0.150");
+ defaults.put("lsi.threshold.candidateCluster", "0.775");
+
+ // Initialize a new Lingo clustering component.
+ ArrayList languageList = new ArrayList(languages.length);
+ for (int i = 0; i < languages.length; i++) {
+ final String lcode = languages[i];
+ try {
+ final Language lang = AllKnownLanguages.getLanguageForIsoCode(lcode);
+ if (lang == null) {
+ logger.warn("Language not supported in Carrot2: " + lcode);
+ } else {
+ languageList.add(lang);
+ logger.debug("Language loaded: " + lcode);
+ }
+ } catch (Throwable t) {
+ logger.warn("Language could not be loaded: " + lcode, t);
+ }
+ }
+ return new LingoLocalFilterComponent(
+ (Language []) languageList.toArray(new Language [languageList.size()]), defaults);
+ }
+ };
+ controller.addLocalComponentFactory("filter-lingo", lingoFactory);
+
+ // * <output component-key="output-clustersConsumer" />
+ LocalComponentFactory clusterConsumerOutputFactory = new LocalComponentFactory() {
+ public LocalComponent getInstance() {
+ return new ArrayOutputComponent();
+ }
+ };
+ controller.addLocalComponentFactory("output-array",
+ clusterConsumerOutputFactory);
+ }
+
+ /**
+ * Adds a hardcoded clustering process to the local controller.
+ */
+ private void addProcesses() {
+ final LocalProcessBase process = new LocalProcessBase(
+ "input-nutch",
+ "output-array",
+ new String [] {"filter-lingo"},
+ "The Lingo clustering algorithm (www.carrot2.org).",
+ "");
+
+ try {
+ controller.addProcess(PROCESS_ID, process);
+ } catch (Exception e) {
+ throw new RuntimeException("Could not assemble clustering process.", e);
+ }
+ }
+}
diff --git a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/HitsClusterAdapter.java b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/HitsClusterAdapter.java
index 82103e20b..45485f25d 100644
--- a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/HitsClusterAdapter.java
+++ b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/HitsClusterAdapter.java
@@ -1,108 +1,108 @@
-/**
- * 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.clustering.carrot2;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.nutch.clustering.HitsCluster;
-import org.apache.nutch.searcher.HitDetails;
-import org.carrot2.core.clustering.RawCluster;
-import org.carrot2.core.clustering.RawDocument;
-
-/**
- * An adapter of Carrot2's {@link RawCluster} interface to
- * {@link HitsCluster} interface.
- */
-public class HitsClusterAdapter implements HitsCluster {
- private RawCluster rawCluster;
- private HitDetails [] hits;
-
- /**
- * Lazily initialized subclusters array.
- */
- private HitsCluster [] subclusters;
-
- /**
- * Lazily initialized documents array.
- */
- private HitDetails [] documents;
-
- /**
- * Creates a new adapter.
- */
- public HitsClusterAdapter(RawCluster rawCluster, HitDetails [] hits) {
- this.rawCluster = rawCluster;
- this.hits = hits;
- }
-
- /*
- * @see org.apache.nutch.clustering.HitsCluster#getSubclusters()
- */
- public HitsCluster[] getSubclusters() {
- if (this.subclusters == null) {
- final List rawSubclusters = rawCluster.getSubclusters();
- if (rawSubclusters == null || rawSubclusters.size() == 0) {
- subclusters = null;
- } else {
- subclusters = new HitsCluster[rawSubclusters.size()];
- int j = 0;
- for (Iterator i = rawSubclusters.iterator(); i.hasNext(); j++) {
- RawCluster c = (RawCluster) i.next();
- subclusters[j] = new HitsClusterAdapter(c, hits);
- }
- }
- }
-
- return subclusters;
- }
-
- /*
- * @see org.apache.nutch.clustering.HitsCluster#getHits()
- */
- public HitDetails[] getHits() {
- if (documents == null) {
- List rawDocuments = this.rawCluster.getDocuments();
- documents = new HitDetails[ rawDocuments.size() ];
-
- int j = 0;
- for (Iterator i = rawDocuments.iterator(); i.hasNext(); j++) {
- RawDocument doc = (RawDocument) i.next();
- Integer offset = (Integer) doc.getId();
- documents[j] = this.hits[offset.intValue()];
- }
- }
-
- return documents;
- }
-
- /*
- * @see org.apache.nutch.clustering.HitsCluster#getDescriptionLabels()
- */
- public String[] getDescriptionLabels() {
- List phrases = this.rawCluster.getClusterDescription();
- return (String []) phrases.toArray( new String [ phrases.size() ]);
- }
-
- /*
- * @see org.apache.nutch.clustering.HitsCluster#isJunkCluster()
- */
- public boolean isJunkCluster() {
- return rawCluster.getProperty(RawCluster.PROPERTY_JUNK_CLUSTER) != null;
- }
-}
-
+/**
+ * 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.clustering.carrot2;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.nutch.clustering.HitsCluster;
+import org.apache.nutch.searcher.HitDetails;
+import org.carrot2.core.clustering.RawCluster;
+import org.carrot2.core.clustering.RawDocument;
+
+/**
+ * An adapter of Carrot2's {@link RawCluster} interface to
+ * {@link HitsCluster} interface.
+ */
+public class HitsClusterAdapter implements HitsCluster {
+ private RawCluster rawCluster;
+ private HitDetails [] hits;
+
+ /**
+ * Lazily initialized subclusters array.
+ */
+ private HitsCluster [] subclusters;
+
+ /**
+ * Lazily initialized documents array.
+ */
+ private HitDetails [] documents;
+
+ /**
+ * Creates a new adapter.
+ */
+ public HitsClusterAdapter(RawCluster rawCluster, HitDetails [] hits) {
+ this.rawCluster = rawCluster;
+ this.hits = hits;
+ }
+
+ /*
+ * @see org.apache.nutch.clustering.HitsCluster#getSubclusters()
+ */
+ public HitsCluster[] getSubclusters() {
+ if (this.subclusters == null) {
+ final List rawSubclusters = rawCluster.getSubclusters();
+ if (rawSubclusters == null || rawSubclusters.size() == 0) {
+ subclusters = null;
+ } else {
+ subclusters = new HitsCluster[rawSubclusters.size()];
+ int j = 0;
+ for (Iterator i = rawSubclusters.iterator(); i.hasNext(); j++) {
+ RawCluster c = (RawCluster) i.next();
+ subclusters[j] = new HitsClusterAdapter(c, hits);
+ }
+ }
+ }
+
+ return subclusters;
+ }
+
+ /*
+ * @see org.apache.nutch.clustering.HitsCluster#getHits()
+ */
+ public HitDetails[] getHits() {
+ if (documents == null) {
+ List rawDocuments = this.rawCluster.getDocuments();
+ documents = new HitDetails[ rawDocuments.size() ];
+
+ int j = 0;
+ for (Iterator i = rawDocuments.iterator(); i.hasNext(); j++) {
+ RawDocument doc = (RawDocument) i.next();
+ Integer offset = (Integer) doc.getId();
+ documents[j] = this.hits[offset.intValue()];
+ }
+ }
+
+ return documents;
+ }
+
+ /*
+ * @see org.apache.nutch.clustering.HitsCluster#getDescriptionLabels()
+ */
+ public String[] getDescriptionLabels() {
+ List phrases = this.rawCluster.getClusterDescription();
+ return (String []) phrases.toArray( new String [ phrases.size() ]);
+ }
+
+ /*
+ * @see org.apache.nutch.clustering.HitsCluster#isJunkCluster()
+ */
+ public boolean isJunkCluster() {
+ return rawCluster.getProperty(RawCluster.PROPERTY_JUNK_CLUSTER) != null;
+ }
+}
+
diff --git a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchDocument.java b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchDocument.java
index a570aef7f..9dd35338d 100644
--- a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchDocument.java
+++ b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchDocument.java
@@ -1,65 +1,65 @@
-/**
- * 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.clustering.carrot2;
-
-import org.apache.nutch.searcher.HitDetails;
-import org.carrot2.core.clustering.RawDocument;
-import org.carrot2.core.clustering.RawDocumentBase;
-
-/**
- * An adapter class that implements {@link RawDocument} required for Carrot2.
- */
-public class NutchDocument extends RawDocumentBase {
- /**
- * Integer identifier of this document. We need a subclass of
- * {@link java.lang.Object}, so this should do.
- */
- private final Integer id;
-
- /**
- * Creates a new document with the given id, <code>summary</code> and wrapping
- * a <code>details</code> hit details.
- */
- public NutchDocument(int id, HitDetails details, String summary, String defaultLanguage) {
- super(details.getValue("url"), details.getValue("title"), summary);
-
- // Handle document language -- attempt to extract it from the details,
- // otherwise set to the default.
- String lang = details.getValue("lang");
- if (lang == null) {
- // No default language. Take the default from the configuration file.
- lang = defaultLanguage;
- }
-
- // Use this language for the snippet. Truncate longer ISO codes
- // to only include two-letter language code.
- if (lang.length() > 2) {
- lang = lang.substring(0, 2);
- }
- lang = lang.toLowerCase();
- super.setProperty(RawDocument.PROPERTY_LANGUAGE, lang);
-
- this.id = Integer.valueOf(id);
- }
-
- /*
- * @see com.dawidweiss.carrot.core.local.clustering.RawDocument#getId()
- */
- public Object getId() {
- return id;
- }
+/**
+ * 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.clustering.carrot2;
+
+import org.apache.nutch.searcher.HitDetails;
+import org.carrot2.core.clustering.RawDocument;
+import org.carrot2.core.clustering.RawDocumentBase;
+
+/**
+ * An adapter class that implements {@link RawDocument} required for Carrot2.
+ */
+public class NutchDocument extends RawDocumentBase {
+ /**
+ * Integer identifier of this document. We need a subclass of
+ * {@link java.lang.Object}, so this should do.
+ */
+ private final Integer id;
+
+ /**
+ * Creates a new document with the given id, <code>summary</code> and wrapping
+ * a <code>details</code> hit details.
+ */
+ public NutchDocument(int id, HitDetails details, String summary, String defaultLanguage) {
+ super(details.getValue("url"), details.getValue("title"), summary);
+
+ // Handle document language -- attempt to extract it from the details,
+ // otherwise set to the default.
+ String lang = details.getValue("lang");
+ if (lang == null) {
+ // No default language. Take the default from the configuration file.
+ lang = defaultLanguage;
+ }
+
+ // Use this language for the snippet. Truncate longer ISO codes
+ // to only include two-letter language code.
+ if (lang.length() > 2) {
+ lang = lang.substring(0, 2);
+ }
+ lang = lang.toLowerCase();
+ super.setProperty(RawDocument.PROPERTY_LANGUAGE, lang);
+
+ this.id = Integer.valueOf(id);
+ }
+
+ /*
+ * @see com.dawidweiss.carrot.core.local.clustering.RawDocument#getId()
+ */
+ public Object getId() {
+ return id;
+ }
}
\ No newline at end of file
diff --git a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchInputComponent.java b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchInputComponent.java
index 34067dea0..74dc59264 100644
--- a/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchInputComponent.java
+++ b/src/plugin/clustering-carrot2/src/java/org/apache/nutch/clustering/carrot2/NutchInputComponent.java
@@ -1,108 +1,108 @@
-/**
- * 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.clustering.carrot2;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.nutch.searcher.HitDetails;
-import org.carrot2.core.LocalInputComponentBase;
-import org.carrot2.core.ProcessingException;
-import org.carrot2.core.RequestContext;
-import org.carrot2.core.clustering.RawDocumentsConsumer;
-import org.carrot2.core.clustering.RawDocumentsProducer;
-
-/**
- * An input component that ignores the query passed from the
- * controller and instead looks for data stored in the request context.
- * This enables us to reuse the same physical component implementation
- * for data that has already been acquired from Nutch.
- */
-public class NutchInputComponent extends LocalInputComponentBase {
- public final static String NUTCH_INPUT_HIT_DETAILS_ARRAY
- = "NUTCH_INPUT_HIT_DETAILS_ARRAY";
-
- public final static String NUTCH_INPUT_SUMMARIES_ARRAY
- = "NUTCH_INPUT_SUMMARIES_ARRAY";
-
- /** Capabilities required from the next component in the chain */
- private final static Set SUCCESSOR_CAPABILITIES = toSet(RawDocumentsConsumer.class);
-
- /** This component's capabilities */
- private final static Set COMPONENT_CAPABILITIES = toSet(RawDocumentsProducer.class);
-
- /**
- * Default language code for hits that don't have their own.
- */
- private String defaultLanguage;
-
- /**
- * Creates an input component with the given default language code.
- */
- public NutchInputComponent(String defaultLanguage) {
- this.defaultLanguage = defaultLanguage;
- }
-
- /*
- * @see com.dawidweiss.carrot.core.local.LocalInputComponent#setQuery(java.lang.String)
- */
- public void setQuery(String query) {
- // ignore the query; data will be provided from the request context.
- }
-
- /**
- * A callback hook that starts the processing.
- */
- public void startProcessing(RequestContext context) throws ProcessingException {
- // let successor components know that the processing has started.
- super.startProcessing(context);
-
- // get the information about documents from the context.
- final Map params = context.getRequestParameters();
- final HitDetails [] details = (HitDetails[]) params.get(NUTCH_INPUT_HIT_DETAILS_ARRAY);
- final String [] summaries = (String[]) params.get(NUTCH_INPUT_SUMMARIES_ARRAY);
-
- if (details == null)
- throw new ProcessingException("Details array must not be null.");
-
- if (summaries == null)
- throw new ProcessingException("Summaries array must not be null.");
-
- if (summaries.length != details.length)
- throw new ProcessingException("Summaries and details must be of the same length.");
-
- // produce 'documents' for successor components.
- final RawDocumentsConsumer consumer = (RawDocumentsConsumer) next;
- for (int i = 0; i < summaries.length; i++) {
- consumer.addDocument(new NutchDocument(i, details[i], summaries[i], defaultLanguage));
- }
- }
-
- /**
- * Returns the capabilities provided by this component.
- */
- public Set getComponentCapabilities() {
- return COMPONENT_CAPABILITIES;
- }
-
- /**
- * Returns the capabilities required from the successor component.
- */
- public Set getRequiredSuccessorCapabilities() {
- return SUCCESSOR_CAPABILITIES;
- }
-}
+/**
+ * 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.clustering.carrot2;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nutch.searcher.HitDetails;
+import org.carrot2.core.LocalInputComponentBase;
+import org.carrot2.core.ProcessingException;
+import org.carrot2.core.RequestContext;
+import org.carrot2.core.clustering.RawDocumentsConsumer;
+import org.carrot2.core.clustering.RawDocumentsProducer;
+
+/**
+ * An input component that ignores the query passed from the
+ * controller and instead looks for data stored in the request context.
+ * This enables us to reuse the same physical component implementation
+ * for data that has already been acquired from Nutch.
+ */
+public class NutchInputComponent extends LocalInputComponentBase {
+ public final static String NUTCH_INPUT_HIT_DETAILS_ARRAY
+ = "NUTCH_INPUT_HIT_DETAILS_ARRAY";
+
+ public final static String NUTCH_INPUT_SUMMARIES_ARRAY
+ = "NUTCH_INPUT_SUMMARIES_ARRAY";
+
+ /** Capabilities required from the next component in the chain */
+ private final static Set SUCCESSOR_CAPABILITIES = toSet(RawDocumentsConsumer.class);
+
+ /** This component's capabilities */
+ private final static Set COMPONENT_CAPABILITIES = toSet(RawDocumentsProducer.class);
+
+ /**
+ * Default language code for hits that don't have their own.
+ */
+ private String defaultLanguage;
+
+ /**
+ * Creates an input component with the given default language code.
+ */
+ public NutchInputComponent(String defaultLanguage) {
+ this.defaultLanguage = defaultLanguage;
+ }
+
+ /*
+ * @see com.dawidweiss.carrot.core.local.LocalInputComponent#setQuery(java.lang.String)
+ */
+ public void setQuery(String query) {
+ // ignore the query; data will be provided from the request context.
+ }
+
+ /**
+ * A callback hook that starts the processing.
+ */
+ public void startProcessing(RequestContext context) throws ProcessingException {
+ // let successor components know that the processing has started.
+ super.startProcessing(context);
+
+ // get the information about documents from the context.
+ final Map params = context.getRequestParameters();
+ final HitDetails [] details = (HitDetails[]) params.get(NUTCH_INPUT_HIT_DETAILS_ARRAY);
+ final String [] summaries = (String[]) params.get(NUTCH_INPUT_SUMMARIES_ARRAY);
+
+ if (details == null)
+ throw new ProcessingException("Details array must not be null.");
+
+ if (summaries == null)
+ throw new ProcessingException("Summaries array must not be null.");
+
+ if (summaries.length != details.length)
+ throw new ProcessingException("Summaries and details must be of the same length.");
+
+ // produce 'documents' for successor components.
+ final RawDocumentsConsumer consumer = (RawDocumentsConsumer) next;
+ for (int i = 0; i < summaries.length; i++) {
+ consumer.addDocument(new NutchDocument(i, details[i], summaries[i], defaultLanguage));
+ }
+ }
+
+ /**
+ * Returns the capabilities provided by this component.
+ */
+ public Set getComponentCapabilities() {
+ return COMPONENT_CAPABILITIES;
+ }
+
+ /**
+ * Returns the capabilities required from the successor component.
+ */
+ public Set getRequiredSuccessorCapabilities() {
+ return SUCCESSOR_CAPABILITIES;
+ }
+}
diff --git a/src/plugin/ontology/lib/jena-2.1.LICENSE.txt b/src/plugin/ontology/lib/jena-2.1.LICENSE.txt
index c51b116e4..2746bdad8 100644
--- a/src/plugin/ontology/lib/jena-2.1.LICENSE.txt
+++ b/src/plugin/ontology/lib/jena-2.1.LICENSE.txt
@@ -1,30 +1,30 @@
-/*
- * (c) Copyright 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-This product includes software developed by the
-Apache Software Foundation (http://www.apache.org/).
+/*
+ * (c) Copyright 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+This product includes software developed by the
+Apache Software Foundation (http://www.apache.org/).
diff --git a/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMBuilder.java b/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMBuilder.java
index 2778d3926..4485ea535 100644
--- a/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMBuilder.java
+++ b/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMBuilder.java
@@ -21,7 +21,7 @@
* limitations under the License.
*/
/*
- * $Id: DOMBuilder.java,v 1.19 2004/02/25 13:07:51 aruny Exp $
+ * $Id$
*/
package org.apache.nutch.parse.html;
diff --git a/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/XMLCharacterRecognizer.java b/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/XMLCharacterRecognizer.java
index fab2589ef..dfc694d94 100644
--- a/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/XMLCharacterRecognizer.java
+++ b/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/XMLCharacterRecognizer.java
@@ -21,7 +21,7 @@
* limitations under the License.
*/
/*
- * $Id: XMLCharacterRecognizer.java,v 1.7 2004/02/17 04:21:14 minchau Exp $
+ * $Id$
*/
package org.apache.nutch.parse.html;
diff --git a/src/plugin/urlfilter-prefix/src/java/org/apache/nutch/urlfilter/prefix/PrefixURLFilter.java b/src/plugin/urlfilter-prefix/src/java/org/apache/nutch/urlfilter/prefix/PrefixURLFilter.java
index faf79a0af..dd759ef93 100644
--- a/src/plugin/urlfilter-prefix/src/java/org/apache/nutch/urlfilter/prefix/PrefixURLFilter.java
+++ b/src/plugin/urlfilter-prefix/src/java/org/apache/nutch/urlfilter/prefix/PrefixURLFilter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: PrefixURLFilter.java,v 1.2 2005/02/07 19:10:37 cutting Exp $
+// $Id$
package org.apache.nutch.urlfilter.prefix;
diff --git a/src/web/include/ca/header.xml b/src/web/include/ca/header.xml
index 62c10fc1f..a4e27fba7 100644
--- a/src/web/include/ca/header.xml
+++ b/src/web/include/ca/header.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<header-menu>
- <item><a href="about.html">Quan a</a></item>
- <item><a href="http://wiki.apache.org/nutch/FAQ">FAQ</a></item>
-</header-menu>
-
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<header-menu>
+ <item><a href="about.html">Quan a</a></item>
+ <item><a href="http://wiki.apache.org/nutch/FAQ">FAQ</a></item>
+</header-menu>
+
diff --git a/src/web/pages/ca/about.xml b/src/web/pages/ca/about.xml
index 022031043..eb04e38fc 100644
--- a/src/web/pages/ca/about.xml
+++ b/src/web/pages/ca/about.xml
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<page>
-
- <title>Quan a</title>
-
-<menu>
- <item><a href="http://lucene.apache.org/nutch/credits.html">Credits</a></item>
- <item><a href="http://lucene.apache.org/nutch/index.html">Status</a></item>
-</menu>
-
-<body>
-
-<p>Nutch �s un nou projecte per implementar un cercador Web amb codi obert.</p>
-
-<p>La cerca al Web �s un requeriment b�sic per la navegaci� a Internet, malgrat aquest fet, el nombre de cercadors disminueix dia a dia. L'oligopoli actual es pot convertir, aviat, en un monopoli amb una �nica companyia controlant gariab� totes les cerques que es facin al Web pels seus interessos comercials.</p>
-
-<p>Nutch proporciona una alternativa transparent als motors de cerca comercials. Nom�s els resultats de cerca obtinguts a partir d'un sistema fet amb codi obert es poden considerar realment fiables i no esbiaxats. Tots els grans cercadors comercials tenen f�rmules de r�nquing propiet�ries, i no explicaran mai perqu� una p�gina en particular surt en una determinada posici� del r�nquing. A m�s, alguns cercadors determinien quins llocs Web indexar en funci� de pagaments i no pas en funci� dels m�rits intr�nsecs del lloc Web. Nutch, per la seva banda, no t� res a amagar ni cap motiu per prioritzar esbiaxadament els seus resultats o el seu crawler, i nom�s busca proporcionar a cada usuari els millors resultats de cerca possibles.</p>
-
-<p>L'objectiu de Nutch �s permetre a qualsevol persona muntar un cercador Web de primera classe de forma barata i efectiva. Per aconseguir-ho, el programari Nutch ha de capa� de:</p>
-<ul>
- <li>Recollir diversos milers de mil�lions de p�gines Web mensualment.</li>
- <li>Mantenir un �ndex d'aquestes p�gines.</li>
- <li>Cercar en aquest �ndex fins a 1000 vegades per segon.</li>
- <li>Proporcionar resultats de cerca d'alta qualitat.</li>
- <li>Operar amb un cost m�nim.</li>
-</ul>
-
-<p>Aquesta proposta �s sens dubte, un repte. Si creus en els m�rits d'aquest projecte, si us plau, ajuda-n's, tant com a <a href="http://www.apache.org/dev/">desenvolupador</a> o amb una <a href="http://www.apache.org/foundation/contributing.html">donaci�</a>
-.</p>
-
-</body>
-</page>
-
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+
+ <title>Quan a</title>
+
+<menu>
+ <item><a href="http://lucene.apache.org/nutch/credits.html">Credits</a></item>
+ <item><a href="http://lucene.apache.org/nutch/index.html">Status</a></item>
+</menu>
+
+<body>
+
+<p>Nutch �s un nou projecte per implementar un cercador Web amb codi obert.</p>
+
+<p>La cerca al Web �s un requeriment b�sic per la navegaci� a Internet, malgrat aquest fet, el nombre de cercadors disminueix dia a dia. L'oligopoli actual es pot convertir, aviat, en un monopoli amb una �nica companyia controlant gariab� totes les cerques que es facin al Web pels seus interessos comercials.</p>
+
+<p>Nutch proporciona una alternativa transparent als motors de cerca comercials. Nom�s els resultats de cerca obtinguts a partir d'un sistema fet amb codi obert es poden considerar realment fiables i no esbiaxats. Tots els grans cercadors comercials tenen f�rmules de r�nquing propiet�ries, i no explicaran mai perqu� una p�gina en particular surt en una determinada posici� del r�nquing. A m�s, alguns cercadors determinien quins llocs Web indexar en funci� de pagaments i no pas en funci� dels m�rits intr�nsecs del lloc Web. Nutch, per la seva banda, no t� res a amagar ni cap motiu per prioritzar esbiaxadament els seus resultats o el seu crawler, i nom�s busca proporcionar a cada usuari els millors resultats de cerca possibles.</p>
+
+<p>L'objectiu de Nutch �s permetre a qualsevol persona muntar un cercador Web de primera classe de forma barata i efectiva. Per aconseguir-ho, el programari Nutch ha de capa� de:</p>
+<ul>
+ <li>Recollir diversos milers de mil�lions de p�gines Web mensualment.</li>
+ <li>Mantenir un �ndex d'aquestes p�gines.</li>
+ <li>Cercar en aquest �ndex fins a 1000 vegades per segon.</li>
+ <li>Proporcionar resultats de cerca d'alta qualitat.</li>
+ <li>Operar amb un cost m�nim.</li>
+</ul>
+
+<p>Aquesta proposta �s sens dubte, un repte. Si creus en els m�rits d'aquest projecte, si us plau, ajuda-n's, tant com a <a href="http://www.apache.org/dev/">desenvolupador</a> o amb una <a href="http://www.apache.org/foundation/contributing.html">donaci�</a>
+.</p>
+
+</body>
+</page>
+
diff --git a/src/web/pages/ca/help.xml b/src/web/pages/ca/help.xml
index c8a7fb8b8..93918368b 100644
--- a/src/web/pages/ca/help.xml
+++ b/src/web/pages/ca/help.xml
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<page>
-
- <title>Ajuda per la cerca</title>
-
-<body>
-
- <h3>Consultes</h3>
-
- Per cercar amb Nutch, simplement escriu algunes paraules.
-<ul>
- <li>Els resultats nom�s inclouen p�gines que contenen <span
- style="font-style: italic;">totes</span> les paraules de la consulta.</li>
- <li>Fes servir cometes per indicar les paraules que han d'apar�ixer, for�osament, una al costat de l'altra, com una frase,
-p.e., <span style="font-weight: bold;">"pilar de sis"</span>.</li>
- <li>La puntuaci� entre paraules tamb� provoca que es cerqui com una frase. Aix�, cercar <span style="font-weight: bold;">http://www.apache.org/</span> �s el mateix que cercar <span style="font-weight: bold;">"http www
-apache org"</span>.</li>
- <li>Les cerques no diferencien entre min�scules i maj�scules, d'aquesta manera, cercar <span
- style="font-weight: bold;">NuTcH</span> �s el mateix que cercar <span
- style="font-weight: bold;">nUtCh</span>.</li>
- <li>Es pot prohibir una paraula de les p�gines que resulten de la cerca posant un signe menys davant seu, p.e., cercar <span style="font-weight: bold;">futbol -lliga</span> buscar� p�gines que parlin de futbol per� que no emprin la paraula "lliga".</li>
- <li>Aix� �s tot!</li>
-</ul>
-<h3>Resultats</h3>
-Cada plana coincident resultat de la cerca t� els seg�ents enlla�os:
-<ul>
- <li>(<span style="color: rgb(51, 51, 255);">en mem�ria</span>) mostra la versi� de la plana que s'ha baixat Nutch.</li>
- <li>(<span style="color: rgb(51, 51, 255);">explicaci�</span>) mostra una explicaci� de com s'ha puntuat aquesta plana</li>
- <li>(<span style="color: rgb(51, 51, 255);">�ncores</span>) mostra la llista d'enlla�os d'entrada indexats per aquesta p�gina.</li>
-</ul>
-
-</body>
-</page>
-
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+
+ <title>Ajuda per la cerca</title>
+
+<body>
+
+ <h3>Consultes</h3>
+
+ Per cercar amb Nutch, simplement escriu algunes paraules.
+<ul>
+ <li>Els resultats nom�s inclouen p�gines que contenen <span
+ style="font-style: italic;">totes</span> les paraules de la consulta.</li>
+ <li>Fes servir cometes per indicar les paraules que han d'apar�ixer, for�osament, una al costat de l'altra, com una frase,
+p.e., <span style="font-weight: bold;">"pilar de sis"</span>.</li>
+ <li>La puntuaci� entre paraules tamb� provoca que es cerqui com una frase. Aix�, cercar <span style="font-weight: bold;">http://www.apache.org/</span> �s el mateix que cercar <span style="font-weight: bold;">"http www
+apache org"</span>.</li>
+ <li>Les cerques no diferencien entre min�scules i maj�scules, d'aquesta manera, cercar <span
+ style="font-weight: bold;">NuTcH</span> �s el mateix que cercar <span
+ style="font-weight: bold;">nUtCh</span>.</li>
+ <li>Es pot prohibir una paraula de les p�gines que resulten de la cerca posant un signe menys davant seu, p.e., cercar <span style="font-weight: bold;">futbol -lliga</span> buscar� p�gines que parlin de futbol per� que no emprin la paraula "lliga".</li>
+ <li>Aix� �s tot!</li>
+</ul>
+<h3>Resultats</h3>
+Cada plana coincident resultat de la cerca t� els seg�ents enlla�os:
+<ul>
+ <li>(<span style="color: rgb(51, 51, 255);">en mem�ria</span>) mostra la versi� de la plana que s'ha baixat Nutch.</li>
+ <li>(<span style="color: rgb(51, 51, 255);">explicaci�</span>) mostra una explicaci� de com s'ha puntuat aquesta plana</li>
+ <li>(<span style="color: rgb(51, 51, 255);">�ncores</span>) mostra la llista d'enlla�os d'entrada indexats per aquesta p�gina.</li>
+</ul>
+
+</body>
+</page>
+
diff --git a/src/web/pages/ca/search.xml b/src/web/pages/ca/search.xml
index a74b83515..cd0e392c3 100644
--- a/src/web/pages/ca/search.xml
+++ b/src/web/pages/ca/search.xml
@@ -1,12 +1,12 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="ca"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Cerca"/>
- <a href="help.html">Ajuda</a>
-</form>
-</center>
-</body>
-</page>
-
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="ca"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Cerca"/>
+ <a href="help.html">Ajuda</a>
+</form>
+</center>
+</body>
+</page>
+
diff --git a/src/web/pages/en/search.xml b/src/web/pages/en/search.xml
index 4d84ce279..505301785 100644
--- a/src/web/pages/en/search.xml
+++ b/src/web/pages/en/search.xml
@@ -1,16 +1,16 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="en"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Search"/>
- <a href="help.html">help</a>
-</form>
-</center>
-<div style="text-align: right;">
-<a href="http://lucene.apache.org/nutch/index.html">
-<img border="0" src="../img/poweredbynutch_01.gif"/>
-</a>
-</div>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="en"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Search"/>
+ <a href="help.html">help</a>
+</form>
+</center>
+<div style="text-align: right;">
+<a href="http://lucene.apache.org/nutch/index.html">
+<img border="0" src="../img/poweredbynutch_01.gif"/>
+</a>
+</div>
+</body>
+</page>
diff --git a/src/web/pages/es/search.xml b/src/web/pages/es/search.xml
index 4b859675b..7803c69cb 100644
--- a/src/web/pages/es/search.xml
+++ b/src/web/pages/es/search.xml
@@ -1,11 +1,11 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="es"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Buscar"/>
- <a href="help.html">ayuda</a>
-</form>
-</center>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="es"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Buscar"/>
+ <a href="help.html">ayuda</a>
+</form>
+</center>
+</body>
+</page>
diff --git a/src/web/pages/nl/search.xml b/src/web/pages/nl/search.xml
index deaaeb7e4..00e4ef531 100644
--- a/src/web/pages/nl/search.xml
+++ b/src/web/pages/nl/search.xml
@@ -1,11 +1,11 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="nl"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Zoeken"/>
- <a href="help.html">Help</a>
-</form>
-</center>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="nl"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Zoeken"/>
+ <a href="help.html">Help</a>
+</form>
+</center>
+</body>
+</page>
diff --git a/src/web/pages/pl/search.xml b/src/web/pages/pl/search.xml
index 3f075bb42..773437c48 100644
--- a/src/web/pages/pl/search.xml
+++ b/src/web/pages/pl/search.xml
@@ -1,16 +1,16 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="pl"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Szukaj"/>
- <a href="help.html">pomoc</a>
-</form>
-</center>
-<div style="text-align: right;">
-<a href="http://lucene.apache.org/nutch/index.html">
-<img border="0" src="../img/poweredbynutch_01.gif"/>
-</a>
-</div>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="pl"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Szukaj"/>
+ <a href="help.html">pomoc</a>
+</form>
+</center>
+<div style="text-align: right;">
+<a href="http://lucene.apache.org/nutch/index.html">
+<img border="0" src="../img/poweredbynutch_01.gif"/>
+</a>
+</div>
+</body>
+</page>
diff --git a/src/web/pages/sh/search.xml b/src/web/pages/sh/search.xml
index e6c015a5d..0f0ccd252 100644
--- a/src/web/pages/sh/search.xml
+++ b/src/web/pages/sh/search.xml
@@ -1,16 +1,16 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="sh"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Pretraži"/>
- <a href="help.html">pomoć</a>
-</form>
-</center>
-<div style="text-align: right;">
-<a href="http://lucene.apache.org/nutch/index.html">
-<img border="0" src="../img/poweredbynutch_01.gif"/>
-</a>
-</div>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="sh"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Pretraži"/>
+ <a href="help.html">pomoć</a>
+</form>
+</center>
+<div style="text-align: right;">
+<a href="http://lucene.apache.org/nutch/index.html">
+<img border="0" src="../img/poweredbynutch_01.gif"/>
+</a>
+</div>
+</body>
+</page>
diff --git a/src/web/pages/sr/search.xml b/src/web/pages/sr/search.xml
index 1ea1c183a..db399c5b4 100644
--- a/src/web/pages/sr/search.xml
+++ b/src/web/pages/sr/search.xml
@@ -1,16 +1,16 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get">
- <input type="hidden" name="lang" value="sr"/>
- <input name="query" size="44"/>&#160;<input type="submit" value="Претражи"/>
- <a href="help.html">помоћ</a>
-</form>
-</center>
-<div style="text-align: right;">
-<a href="http://lucene.apache.org/nutch/index.html">
-<img border="0" src="../img/poweredbynutch_01.gif"/>
-</a>
-</div>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get">
+ <input type="hidden" name="lang" value="sr"/>
+ <input name="query" size="44"/>&#160;<input type="submit" value="Претражи"/>
+ <a href="help.html">помоћ</a>
+</form>
+</center>
+<div style="text-align: right;">
+<a href="http://lucene.apache.org/nutch/index.html">
+<img border="0" src="../img/poweredbynutch_01.gif"/>
+</a>
+</div>
+</body>
+</page>
diff --git a/src/web/pages/th/search.xml b/src/web/pages/th/search.xml
index 9c3abe57d..4f67a9df3 100644
--- a/src/web/pages/th/search.xml
+++ b/src/web/pages/th/search.xml
@@ -1,10 +1,10 @@
-<page>
-<body>
-<center>
-<form name="search" action="../search.jsp" method="get"> <input
- name="query" size="44"/>&#160;<input type="submit" value="ค้นหา"/>
-<a href="help.html">คำแนะนำการใช้</a>
-</form>
-</center>
-</body>
-</page>
+<page>
+<body>
+<center>
+<form name="search" action="../search.jsp" method="get"> <input
+ name="query" size="44"/>&#160;<input type="submit" value="ค้นหา"/>
+<a href="help.html">คำแนะนำการใช้</a>
+</form>
+</center>
+</body>
+</page>