A macOS database at ~/Library/Keyboard/VulgarWordUsage.db records recognized swear-word use by app and recipient, apparently so autocorrect can learn when not to replace a user’s chosen word with a cleaner suggestion. Its fields track the word, recipient, app, count and last-use time. The database examined was empty, and typing profanity in TextEdit did not populate it, leaving unclear whether recording depends on particular apps or settings. The keyboard’s word classifications come from Apple’s system dictionaries, accessed through private, undocumented functions in Lexicon.framework; no public API exposes them.
Dumping the English dictionary revealed three non-overlapping labels among 4,271 of roughly 199,000 entries: “vulgar” for swearing and sexual slang, “offensive” mainly for slurs, and “sensitive” for a wider range of words that keyboards should avoid suggesting unprompted. A separate set of up to eleven topic flags marks subjects such as sex, drugs, religion, politics and violence. The classifications can be unexpected: Oedipus is vulgar; Tom and Mick are offensive; and pee, poo, niggle and underling are sensitive. Trump is the only living politician in the English sensitive tier, alongside historical figures and groups such as Hitler, Mao, Osama bin Laden and the Taliban, while Biden, Obama and Putin are unflagged. The author provides C and Swift code for reading the flags and dumps for 15 languages.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.