fake_Wuggy | R Documentation |
This function takes a list of tokens and returns a list of potential generated pseudowords by using the Wuggy. Note: you should check the list, as random generation can generate a new real token. Note: this function is fairly slow as the word list gets larger. This function uses bigrams as syllables for one syllable words.
fake_Wuggy(wordlist, language_hyp, lang, replacewords)
wordlist |
A list of valid words from which to calculate the frequencies of syllables and transition ngrams from. |
language_hyp |
The language hyphenation you want to use. You can find them to download at https://hyphenation.org/. Or check out the ones we used in our package /inst/latex. |
lang |
The two letter language code for the language you imported for hyphenation. |
replacewords |
A list of tokens you want to use to create your pseudowords. |
A dataset of original tokens and suggested pseudowords.
Number id for each unique word
First syllable in pairs of syllables.
Pair of syllables together.
Second syllable in the pairs of syllables.
Number of syllables in the token.
Frequency of the syllable pair.
Replacement option wherein one of the syllables has been changed.
The replacement syllable.
The frequency of the replacement syllable pair.
The difference in frequency of the transition pair.
Number of characters difference in the original pair and the replacement pair.
Number of letters difference in the original pair and the replacement pair. If the replacement includes the same letters, the difference would be zero. These values are excluded from being options.
The original token.
The final replacement token.
# af_wuggy <- fake_Wuggy(
# wordlist = af_final$sentence, # full valid options in language
# language_hyp = "../inst/latex/hyph-af.tex", # path to hyphenation.tex
# lang = "af", # two letter language code
# replacewords <- unique(af_top_sim$cue[1:20]) # words you want to create pseudowords for
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.