edu.stanford.nlp.util
Interface Function<T1,T2>

Type Parameters:
T1 - The domain of the function
T2 - The range of the function
All Known Subinterfaces:
SerializableFunction<T1,T2>
All Known Implementing Classes:
AbstractTreebankParserParams.AnnotatePunctuationFunction, Americanize, IdentityFunction, LowercaseFunction, MaxentTagger, Morphology, ObjectBank.PathToFileFunction

public interface Function<T1,T2>

An interface for classes that act as a function transforming one object to another.

Implementation note: A function by itself is not serializable. We do however also provide an interface SerializableFunction for the common case of a function that should be Serializable.

Author:
Dan Klein

Method Summary
 T2 apply(T1 in)
          Converts a T1 to a different T2.
 

Method Detail

apply

T2 apply(T1 in)
Converts a T1 to a different T2. For example, a Parser will convert a Sentence to a Tree. A Tagger will convert a Sentence to a TaggedSentence.

Parameters:
in - The function's argument
Returns:
The function's evaluated value


Stanford NLP Group