Package smile.nlp

Class NGram

java.lang.Object
smile.nlp.NGram
Direct Known Subclasses:
NGram

public class NGram extends Object
An n-gram is a contiguous sequence of n words from a given sequence of text. An n-gram of size 1 is referred to as an unigram; size 2 is a bigram; size 3 is a trigram.
  • Field Details

    • words

      public final String[] words
      Immutable word sequences.
  • Constructor Details

    • NGram

      public NGram(String[] words)
      Constructor.
      Parameters:
      words - the n-gram word sequence.
  • Method Details