getters {ngram}R Documentation

ngram Getters

Description

Some simple "getters" for ngram objects. Necessary since the internal representation is not a native R object.

Usage

get.ngrams(ng)

## S4 method for signature 'ngram'
get.ngrams(ng)

get.string(ng)

## S4 method for signature 'ngram'
get.string(ng)

get.nextwords(ng)

## S4 method for signature 'ngram'
get.nextwords(ng)

Arguments

ng

An ngram object.

Details

get.ngrams() returns an R vector of all n-grams.

get.nextwords() does nothing at the moment; it will be implemented in future releases.

getnstring() recovers the input string as an R string.

See Also

ngram-class, ngram

Examples

library(ngram)

str <- "A B A C A B B"
ng <- ngram(str)
get.ngrams(ng)


[Package ngram version 3.0.4 Index]