de.fu_berlin.ties.context.sensor
Class ListSensor
java.lang.Object
de.fu_berlin.ties.context.sensor.BaseSensor
de.fu_berlin.ties.context.sensor.ListSensor
- All Implemented Interfaces:
- Sensor
public class ListSensor
- extends BaseSensor
A list sensor uses a one or several gazetteers to look up semantic
information. Gazetteers are text files in a very simple format, they just
contain one entry per line. Gazetters must be in the character set configured
by the IOUtils.KEY_LOCAL_CHARSET
(or in the
local default character set if there is no entry for this key).
- Version:
- $Revision: 1.10 $, $Date: 2006/10/21 16:04:06 $, $Author: siefkes $
- Author:
- Christian Siefkes
Method Summary |
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). |
String |
toString()
Returns a string representation of this object. |
ListSensor
public ListSensor(TiesConfiguration conf)
throws IOException
- Creates a new instance.
- Parameters:
conf
- the configuration to use
- Throws:
IOException
- if an I/O error occurs while reading the gazetteers
to use
lookup
public 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
toString
public String toString()
- Returns a string representation of this object.
- Overrides:
toString
in class Object
- Returns:
- a textual representation
Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.