public class NGram extends NodeValue implements Comparable<NGram>
| Modifier and Type | Field and Description |
|---|---|
Set<Context> |
contexts |
int |
length |
Set<Node> |
nodes
Public members.
|
| Modifier and Type | Method and Description |
|---|---|
static NGram |
buildNGram(Graph ngrams,
Sentence s,
List<Integer> token_span,
double max_rank)
Factory method.
|
static int |
calcStats(Graph subgraph)
Determine a statistical distribution for the n-gram subgraph.
|
static Graph |
collectNGrams(LanguageModel lang,
List<Sentence> s_list,
double rank_threshold)
Report the n-grams marked in each sentence.
|
int |
compareTo(NGram that)
Compare method for sort ordering.
|
boolean |
equals(Object obj) |
int |
getCount()
Determine the count, i.e., how often this n-gram recurs within
the text.
|
String |
getDescription()
Create a description text for this value.
|
int |
hashCode() |
String |
renderContexts()
Short-cut replacement for a toString() method.
|
getCollocationpublic int getCount()
public String getDescription()
getDescription in class NodeValuepublic String renderContexts()
public int compareTo(NGram that)
compareTo in interface Comparable<NGram>public static NGram buildNGram(Graph ngrams, Sentence s, List<Integer> token_span, double max_rank)
public static Graph collectNGrams(LanguageModel lang, List<Sentence> s_list, double rank_threshold)
public static int calcStats(Graph subgraph)
Copyright © 2017. All rights reserved.