code_ngrams: Code n-grams

Description Usage Arguments Value See Also Examples

View source: R/ngram_coding.R

Description

Code human-friendly representation of n-grams into a biogram format.

Usage

1
code_ngrams(decoded_ngrams)

Arguments

decoded_ngrams

a character vector of decoded n-grams.

Value

a character vector of n-grams.

See Also

Inverse function: decode_ngrams.

Examples

1
2
code_ngrams(c("11_2", "1__12", "222"))
code_ngrams(c("aaa_b", "d__aa", "abd"))

Example output

Loading required package: slam
[1] "1.1.2_0.1" "1.1.2_2.0" "2.2.2_0.0"
[1] "a.a.a.b_0.0.1" "d.a.a_2.0"     "a.b.d_0.0"    

biogram documentation built on March 31, 2020, 5:14 p.m.