com.aliasi.sentences
Class SentenceEvaluator

java.lang.Object
  extended by com.aliasi.sentences.SentenceEvaluator
All Implemented Interfaces:
Handler, ObjectHandler<Chunking>

public class SentenceEvaluator
extends Object
implements ObjectHandler<Chunking>

A SentenceEvaluator handles reference chunkings by constructing a response chunking and adding them to a sentence evaluation. The resulting evaluation may be retrieved through the method evaluation() at any time.

This evaluator class implements the ObjectHandler<Chunking> interface. The chunkings passed to the handle(Chunking) method are treated as reference chunkings. Their character sequence is extracted using Chunking.charSequence() and the contained sentence chunker is used to produce a response chunking over the character sequence. The resulting pair of chunkings is passed to the contained sentence evaluation.

Since:
LingPipe2.1
Version:
3.9
Author:
Bob Carpenter

Constructor Summary
SentenceEvaluator(SentenceChunker sentenceChunker)
          Construct a sentence evaluator using the specified sentence chunker to construct responses.
 
Method Summary
 SentenceEvaluation evaluation()
          Return the evaluation for this evaluator.
 void handle(Chunking refChunking)
          Handle the specified reference chunking by extracting its character sequence, producing a response chunking from the contained sentence chunker, and adding the reference and result to the evaluation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SentenceEvaluator

public SentenceEvaluator(SentenceChunker sentenceChunker)
Construct a sentence evaluator using the specified sentence chunker to construct responses.

Parameters:
sentenceChunker - Sentence chunker for responses.
Method Detail

handle

public void handle(Chunking refChunking)
Handle the specified reference chunking by extracting its character sequence, producing a response chunking from the contained sentence chunker, and adding the reference and result to the evaluation.

Specified by:
handle in interface ObjectHandler<Chunking>
Parameters:
refChunking - Refernece chunking.

evaluation

public SentenceEvaluation evaluation()
Return the evaluation for this evaluator. This may be inspected at any time. If evaluations are later added to this evaluator, the returned evaluation will reflect them.

Returns:
Sentence evaluation for this evaluator.