|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.language.identification.ngram.NGram
public class NGram
A simple, straightforward n-gram implementation. This NGram has an additional field for capturing the number of occurrences of an ngram. This field is optional and completely ignored by the equals and hashCode methods.
| Constructor Summary | |
|---|---|
NGram(char[] chars,
int start,
int length,
int count)
|
|
| Method Summary | |
|---|---|
int |
compareTo(NGram other)
|
boolean |
equals(char[] chars,
int start,
int length)
|
boolean |
equals(Object object)
|
int |
getCount()
Returns the number of occurrences of this NGram, or a negative value when the count is not used. |
int |
hashCode()
|
static int |
hashCode(char[] chars,
int start,
int length)
Create a hash code for the specified char sequence. |
void |
increaseCount()
Increase the count with one. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NGram(char[] chars,
int start,
int length,
int count)
| Method Detail |
|---|
public int getCount()
public void increaseCount()
public int compareTo(NGram other)
compareTo in interface Comparable<NGram>
public boolean equals(char[] chars,
int start,
int length)
public boolean equals(Object object)
equals in class Objectpublic int hashCode()
hashCode in class Object
public static int hashCode(char[] chars,
int start,
int length)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||