summaryrefslogtreecommitdiff
path: root/src/runtime/java/org/grammaticalframework/pgf/TokenProb.java
blob: 36db54273497f2141f71a37e439d112f915acf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.grammaticalframework.pgf;

/** Simply a pair of an expression and a probability value. */
public class TokenProb {
	private String tok;
	private String cat;
	private String fun;
	private double prob;

	public TokenProb(double prob, String tok, String cat, String fun) {
		this.prob = prob;
		this.tok  = tok;
		this.cat  = cat;
		this.fun  = fun;
	}

	/** Returns the negative logarithmic probability. */
	public double getProb() {
		return prob;
	}

	/** Returns the token. */
	public String getToken() {
		return tok;
	}

	/** Returns the category from which this word was predicted. */
	public String getCategory() {
		return cat;
	}
	
	/** Returns the function from which this word was predicted. */
	public String getFunction() {
		return fun;
	}
}