Package opennlp.tools.util
Class Sequence
- java.lang.Object
-
- opennlp.tools.util.Sequence
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String outcome, double p)Adds an outcome and probability to this sequence.intcompareTo(Sequence s)booleanequals(java.lang.Object obj)java.util.List<java.lang.String>getOutcomes()Returns a list of outcomes for this sequence.double[]getProbs()Returns an array of probabilities associated with the outcomes of this sequence.voidgetProbs(double[] ps)Populates an array with the probabilities associated with the outcomes of this sequence.doublegetScore()Returns the score of this sequence.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
compareTo
public int compareTo(Sequence s)
- Specified by:
compareToin interfacejava.lang.Comparable<Sequence>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
add
public void add(java.lang.String outcome, double p)Adds an outcome and probability to this sequence.- Parameters:
outcome- the outcome to be added.p- the probability associated with this outcome.
-
getOutcomes
public java.util.List<java.lang.String> getOutcomes()
Returns a list of outcomes for this sequence.- Returns:
- a list of outcomes.
-
getProbs
public double[] getProbs()
Returns an array of probabilities associated with the outcomes of this sequence.- Returns:
- an array of probabilities.
-
getScore
public double getScore()
Returns the score of this sequence.- Returns:
- The score of this sequence.
-
getProbs
public void getProbs(double[] ps)
Populates an array with the probabilities associated with the outcomes of this sequence.- Parameters:
ps- a pre-allocated array to use to hold the values of the probabilities of the outcomes for this sequence.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-