Package opennlp.tools.util
Klasse Sequence
java.lang.Object
opennlp.tools.util.Sequence
- Alle implementierten Schnittstellen:
Comparable<Sequence>
Represents a weighted sequence of outcomes.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Adds an outcome and probability to this sequence.int
boolean
getOutcome
(int index) double
getProb
(int index) double[]
getProbs()
void
getProbs
(double[] ps) Populates an array with the probabilities associated with theSequence
outcomes.double
getScore()
int
getSize()
int
hashCode()
toString()
-
Konstruktordetails
-
Sequence
public Sequence()Initializes a newSequence
of outcomes. -
Sequence
- Parameter:
s
- An existingSequence
used as input.
-
Sequence
- Parameter:
s
- An existingSequence
used as input.outcome
- An extra outcome to add tos
.p
- A extra probability of theoutcome
.
-
Sequence
Initializes a newSequence
of outcomes from a list ofoutcomes
. The probabilities for each outcome will be equally initialized toONE
.- Parameter:
outcomes
- Several existing outcomes used as input.
-
-
Methodendetails
-
compareTo
- Angegeben von:
compareTo
in SchnittstelleComparable<Sequence>
-
hashCode
public int hashCode() -
equals
-
add
Adds an outcome and probability to this sequence.- Parameter:
outcome
- the outcome to be added.p
- the probability associated with this outcome.
-
getOutcomes
- Gibt zurück:
- Retrieves a list of outcomes for this
Sequence
.
-
getSize
public int getSize()- Gibt zurück:
- Retrieves the size of the outcomes for this
Sequence
.
-
getOutcome
- Parameter:
index
- must be greater than or equal to zero and must be less thangetSize()
.- Gibt zurück:
- the outcome at the specified index.
- Löst aus:
IndexOutOfBoundsException
- thrown if the given index is out of range.
-
getProb
public double getProb(int index) - Parameter:
index
- must be greater than or equal to zero and must be less thangetSize()
.- Gibt zurück:
- the probability at the specified index.
- Löst aus:
IndexOutOfBoundsException
- thrown if the given index is out of range.
-
getProbs
public double[] getProbs()- Gibt zurück:
- Retrieves an array of probabilities associated with the
Sequence
outcomes.
-
getScore
public double getScore()- Gibt zurück:
- Retrieves the score of this
Sequence
.
-
getProbs
public void getProbs(double[] ps) Populates an array with the probabilities associated with theSequence
outcomes.- Parameter:
ps
- A pre-allocated array to hold the values of the probabilities of the outcomes for thisSequence
.
-
toString
-