Description Usage Arguments Details Value See Also Examples
View source: R/add_remove_ngrams.R
Builds (n+1)-grams from n-grams.
1 | add_1grams(ngram, u, seq_length)
|
ngram |
a single n-gram. |
u |
|
seq_length |
length of an origin sequence. |
n-grams are built by pasting every possible unigram in the every possible free position. The total length of n-gram (n plus total distance between elements of the n-gram) is limited by the length of an origin sequence, because the n-gram cannot be longer than an origin sequence.
vector of n-grams (where n
is equal to the n
of the input plus one).
Reverse function: gap_ngrams
.
1 2 3 | add_1grams("1_2.3.4_3.0", 1L:4, 8)
add_1grams("a.a_1", c("a", "b", "c"), 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.