macOS 系统中存在一个位于 ~/Library/Keyboard/ 路径下的名为 VulgarWordUsage.db 的数据库文件,用于跟踪用户对粗俗词汇的使用情况 1。该数据库表结构包含应用(app)、收件人(recipient)和词汇(vword)等字段,并通过以应用、收件人、单词及读音为唯一索引的组合,将记录粒度细化至具体的应用程序和联系人 1。这一机制旨在通过记录特定语境下的词汇使用频率来调整自动更正建议 1。Craig Federighi 在 2023 年 WWDC 上宣布 iOS 17 自动更正重写时提到:“In those moments where you just want to type a ducking word, well, the keyboard will learn it, too.” 1
通过对系统私有框架 Lexicon.framework 中函数 _LXEntryGetMetaFlags 的逆向工程分析发现,英语字典中共有 4,271 个词条被标记为“粗俗”(vulgar,标志位 0x00800000)、“冒犯”(offensive,标志位 0x01000000)或“敏感”(sensitive,标志位 0x02000000)三个层级之一 1。其中,“Trump”一词在美式英语(en_US)和英式英语(en_GB)字典中被明确标记为“敏感”层级并附加了政治主题标签,而其他在世人物通常没有此标记 1。相比之下,德语字典中的 Hitler 被标记为“冒犯”,瑞典语字典中的 Putin 则被标记为“敏感” 1。推测将 Trump 标记为“敏感”可能与 2025 年 2 月 iPhone 语音输入将“racist”误识别为“Trump”的事件有关,目的是阻止该名字出现在未经提示的建议栏中 1。
除了单个词汇的元数据标记外,Apple 的键盘语言模型还依赖 blocklist.dat 文件实施序列屏蔽机制 1。该列表涉及 2,544 个单词和 930 个类别,用于阻止特定短语组合的出现,例如禁止“deny”一词后紧跟“Holocaust”的情况 1。
A detailed technical analysis of Apple’s macOS and iOS keyboard systems has exposed the underlying mechanisms used to track user vocabulary and flag specific terms as sensitive, vulgar, or offensive. 1 The investigation centered on a local database file located at ~/Library/Keyboard/VulgarWordUsage.db, which records word usage frequency with granularity down to individual applications and recipients, utilizing a unique index composed of app, recipient, word, and reading fields. 1 This data allows the system to adjust autocorrect suggestions based on context, a feature highlighted by Craig Federighi during the 2023 WWDC when he stated regarding iOS 17's rewritten autocorrection: “In those moments where you just want to type a ducking word, well, the keyboard will learn it, too.” 1
By reverse-engineering private APIs within the Lexicon.framework, specifically the function _LXEntryGetMetaFlags, researchers identified 4,271 English dictionary entries categorized into three distinct tiers: vulgar (flagged with hex code 0x00800000), offensive (0x01000000), and sensitive (0x02000000). 1 Notably, the name “Trump” is marked as “sensitive” and tagged with a “politics” theme in both en_US and en_GB dictionaries, a classification not typically applied to other living public figures. 1 In contrast, other languages apply different flags; for instance, “Hitler” is marked as offensive in German dictionaries, while “Putin” carries a sensitive flag in Swedish dictionaries. 1 It is hypothesized that Trump’s sensitive status may be related to an incident in February 2025 where iPhone voice input misidentified the word “racist” as “Trump,” suggesting the flag serves to prevent such names from appearing in unprompted suggestion bars. 1
Beyond single-word classifications, Apple employs additional controls through a blocklist mechanism to restrict specific phrase sequences. 1 A file named blocklist.dat is used to prevent certain combinations, such as blocking the word “Holocaust” from following “deny.” 1 This sequence-blocking system covers 930 categories and involves 2,544 words, indicating a comprehensive effort to manage content sensitivity within the language model beyond simple dictionary flags. 1
评论
还没有评论,欢迎留下第一条。