View Javadoc

1   /*
2    * Copyright (C) 2005-2006 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, visit
19   * http://www.gnu.org/licenses/gpl.html or write to the Free Software
20   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21   */
22  package de.fu_berlin.ties.classify.feature;
23  
24  import java.io.IOException;
25  import java.io.Reader;
26  
27  import de.fu_berlin.ties.ProcessingException;
28  
29  /***
30   * Feature extractors extract features from text sequences.
31   *
32   * <p>Classes implementing this interface should provide a public constructor
33   * that accepts a {@link de.fu_berlin.ties.TiesConfiguration} as first argument
34   * and a
35   * {@linkplain de.fu_berlin.ties.TiesConfiguration#adaptKey(String, String)
36   * suffix string} as second argument to allow reflection-based loading.
37   *
38   * @author Christian Siefkes
39   * @version $Revision: 1.4 $, $Date: 2006/10/21 16:03:57 $, $Author: siefkes $
40   */
41  public interface FeatureExtractor {
42  
43      /***
44       * Extracts a vector of relevant features from a text sequence.
45       *
46       * @param reader a reader containing the text to represent
47       * @return a feature vector representing the input text sequence
48       * @throws IOException if an I/O error occurs while reading the input
49       * @throws ProcessingException if an error occurs while processing the input
50       */
51      FeatureVector buildFeatures(final Reader reader)
52      throws IOException, ProcessingException;
53  
54  }