This routine processes a string into an ngram class
object.
Usage
## S3 method for class 'character':
ngram(x, n=2)
Arguments
x
The input text.
n
The 'n' as in 'n-gram'.
Details
The ngram() function is the main workhorse of this package.
It takes an input string and converts it into the internal n-gram
representation.
On evaluation, a copy of the input string is produced and stored
as an external pointer. This is necessary because the internal
list representation just points to the first char of each word
in the input string. So if you (or R's gc) deletes the input
string, basically all hell breaks loose.