Description Usage Arguments Value
View source: R/get-n-gram-weights.R
Tabulates weights for all possible n-grams of a given order.
1 | get_n_gram_weights(mod, order, pos = 1L, time = 0, zero_indexed = FALSE)
|
mod |
A PPM model object as produced by (for example)
|
order |
(Integerish scalar) The order (i.e. number of symbols) of the n-grams to retrieve. |
pos |
(Integerish scalar) The nominal 'position' at which the n-gram counts are retrieved (only relevant for decay-based models). |
time |
(Numeric scalar) The nominal 'time' at which the n-grams are retrieved (only relevant for decay-based models). |
zero_indexed |
(Logical scalar) Whether the n-grams should be presented as zero-indexed (as opposed to one-indexed) integer vectors. |
Returns a tibble
where each row corresponds to an n-gram.
These n-grams are exhaustively enumerated from all possible symbols drawn from the model's alphabet.
The tibble contains n columns elt_1
, elt_1
, ... elt_n
,
corresponding to the n symbols in the n-gram,
and a column weight
, identifying the weight of the specified n-gram.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.