Skip to contents

Searches 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.

Usage

make_pseudoword(word, bigrams, lexset, usedset, alphabet = NULL)

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.

Value

A single pseudoword string, or NULL if no legal candidate exists.