com.aliasi.tag
Class ScoredTagging<E>

java.lang.Object
  extended by com.aliasi.tag.Tagging<E>
      extended by com.aliasi.tag.ScoredTagging<E>
Type Parameters:
E - Type of tokens in the tagging.
All Implemented Interfaces:
Scored

public class ScoredTagging<E>
extends Tagging<E>
implements Scored

A ScoredTagging<E> represents a tagging of type E along with a real-valued score.

Since:
LingPipe3.9
Version:
3.9
Author:
Bob Carpenter

Field Summary
 
Fields inherited from interface com.aliasi.util.Scored
REVERSE_SCORE_COMPARATOR, SCORE_COMPARATOR
 
Constructor Summary
ScoredTagging(List<E> tokens, List<String> tags, double score)
          Construct a scored tagging with the specified tokens, tags, and score.
 
Method Summary
 double score()
          Return the score for this tagging.
 String toString()
          Returns a string-based representation of this scored tagging.
 
Methods inherited from class com.aliasi.tag.Tagging
size, tag, tags, token, tokens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScoredTagging

public ScoredTagging(List<E> tokens,
                     List<String> tags,
                     double score)
Construct a scored tagging with the specified tokens, tags, and score. The token and tag lists are copied so that subsequent changes to the list will not affect the constructed tagging.

Parameters:
tokens - Tokens for the tagging.
tags - Tags for the tagging.
score - Score for the tagging.
Throws:
IllegalArgumentException - If the lists are not of the same size.
Method Detail

score

public double score()
Return the score for this tagging.

Specified by:
score in interface Scored
Returns:
Score for this tagging.

toString

public String toString()
Returns a string-based representation of this scored tagging.

Overrides:
toString in class Tagging<E>
Returns:
String-based representation of this scored tagging.