summaryrefslogtreecommitdiff
path: root/src/Chapter4/classification/bayes/WordCountPair.java
blob: b96be92e33d9883e8605cdb81d153158a6976f4e (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
package Chapter4.classification.bayes;

public class WordCountPair implements Comparable<WordCountPair>{

	
	private String word;
	private double count;
	
	public WordCountPair(String word, double count){
		this.word = word;
		this.count = count;
	}
	
	public int compareTo(WordCountPair arg0) {
		return arg0.count - count < 0 ? -1 : 1;
	}

	public String getWord() {
		return word;
	}

	public void setWord(String word) {
		this.word = word;
	}

	public double getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
 
}