public class NGram extends Object implements Comparable<NGram>
Constructor and Description |
---|
NGram()
Default constructor for empty NGram
|
NGram(int n,
List<String> words)
Creates an NGram of degree n consisting of the list of words.
|
NGram(int n,
String... words)
Creates an NGram of degree n consisting of a list of words.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(NGram o) |
boolean |
equals(Object obj) |
int |
getN()
Gets the N used by this NGram.
|
String |
getWordN(int index)
Get the Nth word in this NGram.
|
List<String> |
getWords()
Gets the words in this NGram.
|
int |
hashCode() |
ListIterator<String> |
iterator()
Get an iterator over the words of the NGram.
|
String |
toString() |
public NGram()
public NGram(int n, String... words)
n
- The degree of the NGramwords
- The words of the NGrampublic int getN()
public List<String> getWords()
public String getWordN(int index)
index
- the index of the word in the NGrampublic ListIterator<String> iterator()
public int compareTo(NGram o)
compareTo
in interface Comparable<NGram>
Copyright © 2021 Actian Corporation. All rights reserved.