|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StringDistrib
Interface for objects that define probability distributions over strings.
In addition to passing strings to the getProb
or getLogProb
methods, a client can pass one string to
setString
and then call versions of getProb
and getLogProb
that operate on substrings of that string.
Some implementations may be able to preprocess the string passed to
setString
and return the probabilities of substrings
very efficiently.
Method Summary | |
---|---|
double |
getLogProb(int start,
int end)
Returns the natural log probability of the substring from the given start index up to the given end index in the string passed to the last call to setString |
double |
getLogProb(java.lang.String str)
Returns the natural log probability of the given string. |
double |
getProb(int start,
int end)
Returns the probability of the substring from the given start index up to the given end index in the string passed to the last call to setString |
double |
getProb(java.lang.String str)
Returns the probability of the given string. |
void |
setString(java.lang.String str)
Sets the string to be used by subsequent calls to the substring versions of getProb and getLogProb . |
Method Detail |
---|
void setString(java.lang.String str)
getProb
and getLogProb
.
double getProb(java.lang.String str)
double getProb(int start, int end)
setString
java.lang.IllegalStateException
- if setString
has not
been called
java.lang.IllegalArgumentException
- if the given start and end indices
are not valid in the specified stringdouble getLogProb(java.lang.String str)
double getLogProb(int start, int end)
setString
java.lang.IllegalStateException
- if setString
has not
been called
java.lang.IllegalArgumentException
- if the given start and end indices
are not valid in the specified string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |