The most bigram-plausible legal non-word at the smallest edit distance
Source:R/generation.R
make_pseudoword.RdSearches single-letter substitutions first, then two-letter substitutions; candidates are ranked by summed bigram frequency with a byte-order tie-break, so the choice is deterministic and identical across engines.
Arguments
- word
The base word to derive the pseudoword from.
- bigrams
Named integer vector of bigram counts, from
bigram_counts().- lexset
Environment used as a set of the real word forms a pseudoword must avoid.
- usedset
Environment used as a set of the pseudowords already taken.
- alphabet
Character vector of the letters substituted in, in UTF-8 byte order. The default,
NULL, takes the letters of the bigram table's names, which hold every letter a legal candidate of two letters or more can use.generate_pseudowords()passes the letters of the whole reference.