de.fu_berlin.ties.context.sensor
Interface Sensor

All Known Implementing Classes:
BaseSensor, ListSensor

public interface Sensor

A sensor is an object that looks up information for a token, for example semantic information from gazetteers or thesauri.

Version:
$Revision: 1.6 $, $Date: 2006/10/21 16:04:07 $, $Author: siefkes $
Author:
Christian Siefkes

Method Summary
 void initDocument(File filename, TokenizerFactory tFactory)
          Called when starting to process a new document.
 KeyValue[] lookup(String token)
          Looks up a token and returns the information as an array of key/value pairs (values can be null, but null are not allowed).
 

Method Detail

initDocument

void initDocument(File filename,
                  TokenizerFactory tFactory)
                  throws ProcessingException,
                         IOException
Called when starting to process a new document.

Parameters:
filename - the name of the file
tFactory - a factory that can be used for creating tokenizers, if required
Throws:
ProcessingException - if an error occurs while starting to process the document
IOException - if an I/O error occurs

lookup

KeyValue[] lookup(String token)
Looks up a token and returns the information as an array of key/value pairs (values can be null, but null are not allowed). If no information for the given token can be found, an empty array (length 0) is returned.

Parameters:
token - the token to look up
Returns:
an array of key/value pairs describing the token


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.