diff options
Diffstat (limited to 'src/runtime/java/org/grammaticalframework')
| -rw-r--r-- | src/runtime/java/org/grammaticalframework/pgf/TokenProb.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/runtime/java/org/grammaticalframework/pgf/TokenProb.java b/src/runtime/java/org/grammaticalframework/pgf/TokenProb.java index 3e0c4c62c..2c4ce4447 100644 --- a/src/runtime/java/org/grammaticalframework/pgf/TokenProb.java +++ b/src/runtime/java/org/grammaticalframework/pgf/TokenProb.java @@ -3,11 +3,18 @@ package org.grammaticalframework.pgf; /** Simply a pair of an expression and a probability value. */ public class TokenProb { private String tok; + private String cat; private double prob; - public TokenProb(String tok, double prob) { - this.tok = tok; + public TokenProb(double prob, String tok, String cat) { this.prob = prob; + this.tok = tok; + this.cat = cat; + } + + /** Returns the negative logarithmic probability. */ + public double getProb() { + return prob; } /** Returns the token. */ @@ -15,8 +22,8 @@ public class TokenProb { return tok; } - /** Returns the negative logarithmic probability. */ - public double getProb() { - return prob; + /** Returns the category from which this word was predicted. */ + public String getCategory() { + return cat; } } |
