Description Usage Arguments Details Value Examples
Find n-grams of specified length and return them as a list, or their counts as a table.
1  | 
x | 
 [character vector] Words to be cut into n-grams.  | 
n | 
 [integer] The length of n-grams to look for. Defaults to   | 
borders | 
 [character] Characters to prepend and append to every word. Must be a vector of exactly two character strings. Defaults to   | 
rm | 
 [character] Characters to be removed from   | 
as.table | 
 [logical] Return the result as a table? Defaults to   | 
Data processed with soundcorrs are generally expected to be segmented and aligned, and both segmentation and alignment are recommended to be performed manually. This is a laborious process, but it is feasible when segments represent morphemes or phonemes. Should segments represent n-grams, however, the fully manual approach would have been very time consuming and prone to errors.
[table] Table with counts of n-grams.
1 2 3 4 5  | dataset <- loadSampleDataset ("data-capitals")
ngrams(dataset$data[,"ALIGNED.German"], n=2)
ngrams(dataset$data[,"ALIGNED.German"], n=3, as.table=FALSE)
ngrams(dataset$data[,"ALIGNED.German"], n=4, rm="[-\\|]", as.table=FALSE)
ngrams(dataset$data[,"ALIGNED.German"], n=5, borders=c(">","<"), rm="[-\\|]", as.table=FALSE)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.