mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
A port of iOS's dictation text rules to core/src/dictation/: the styles
(TranscriptFormatter: format, insertion joining, the sentence and period
helpers), Format lists (SpokenLists), Spoken punctuation (SpokenPunctuation),
Clean up's rules for Spanish, German and Norwegian and its English spoken
symbols and counts (SpokenCleanupRules, with CleanupReconstruction), and
French spacing (FrenchSpacing). The Core ML cleanup tagger, custom vocabulary,
Lowercase and locale parsing stay native: the host passes the tagger's output
and the language's code and region as its Locale reads them (ICU canonicalizes
"no" to "nb", "iw" to "he", "eng" to "en").
The rules keep Swift's semantics where they decide an output: Characters are
grapheme clusters, strings compare by canonical equivalence, case mappings go
scalar by scalar, `folding` is CoreFoundation's CFStringFold (its own case
table and mark rules, fold.rs), and the NSRegularExpression patterns are
matched by hand with ICU's rules (`\s`, `\b`, `\p{L}`, `$`), each pattern a
fixed alternation whose backtracking a greedy match reproduces (regex.rs).
iOS's Unicode data where it differs from Rust's or Rust has none (isLetter,
isNumber with Han numerals, ICU's sets, CF's Grapheme_Extend and folds) is
generated from the iOS 27 simulator (tools/dictation_unicode_tables.py).
The oracle: ios/HEXMobileTests/DictationParity holds copies of the Swift
files (dev
|
||
| .. | ||
| dictation_unicode_tables.py | ||