Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anonymizer ¶
type Anonymizer struct { // The dictionary to use to see if a word is a dictionary word. Dict *Dict // The placeholder to use instead of uppercase letters. Uppercase rune // The placeholder to use instead of lowercase letters. Lowercase rune // The placeholder to use instead of digits. Digit rune }
func New ¶
func New(dict *Dict) Anonymizer
func (Anonymizer) Anonymize ¶
func (a Anonymizer) Anonymize(text string) string
Replace with a placeholder all non-dictionary words in the text.
type Dict ¶
type Dict = trie.Trie[struct{}]
Dictionary of words.
func LoadDict ¶
Load dictionary for the given language.
If the language is not found or not provided, the default one will be used. Run `sudo select-default-wordlist` to change the system default.
func MustLoadDict ¶
A wrapper around LoadDict that panics on error.
Click to show internal directories.
Click to hide internal directories.