Skip to contents

Merges list of unique words from `fst_get_unique_ngrams()` with output of `fst_freq_table()` or `fst_ngrams_table()` so that unique words can be displayed on comparison plots.

Usage

fst_join_unique(table, unique_table)

Arguments

table

Output of `fst_freq_table()` or `fst_ngrams_table()`.

unique_table

Output of `fst_get_unique_ngrams()`.

Value

A table of top n-grams, frequency, and whether the n-gram is "unique".

Examples

top_child <- fst_freq_table(fst_child)
#> Note:
#>  Words with equal occurrence are presented in alphabetical order. 
#>  By default, words are presented in order to the `number` cutoff word. 
#>  This means that equally-occurring later-alphabetically words beyond the cutoff word will not be displayed.
#> 
top_dev <- fst_freq_table(fst_dev_coop)
#> Note:
#>  Words with equal occurrence are presented in alphabetical order. 
#>  By default, words are presented in order to the `number` cutoff word. 
#>  This means that equally-occurring later-alphabetically words beyond the cutoff word will not be displayed.
#> 
unique_words <- fst_get_unique_ngrams_separate(top_child, top_dev)
fst_join_unique(top_child, unique_words)
#>       words occurrence word_type
#> 1    toinen        118    Unique
#> 2     lyödä         71    Unique
#> 3  lyöminen         53    Unique
#> 4      joku         46    Unique
#> 5      paha         43    Unique
#> 6     tehdä         34    Unique
#> 7     sanoa         33    Unique
#> 8    tietää         32    Unique
#> 9     jokin         30    Unique
#> 10    tulla         30    Unique
fst_join_unique(top_dev, unique_words)
#>             words occurrence word_type
#> 1         köyhyys        258    Unique
#> 2       nälänhätä        239    Unique
#> 3            sota        231    Unique
#> 4  ilmastonmuutos        141    Unique
#> 5           puute        117    Unique
#> 6         ihminen        105    Unique
#> 7            vesi         98    Unique
#> 8    epätasa-arvo         87    Unique
#> 9          ahneus         84    Unique
#> 10          nälkä         81    Unique