Use shared reader core v0.4.0
Use common date/time formatting, locale voice selection, tone synthesis, phonetic spelling, and hardware command encoding. Share whiskey and x ray spelling and retain reader-owned device I/O and presentation. Validated affected race-enabled speech, sound, presentation, date/time, application, review, and preferences tests and standalone builds with GOWORK=off against the published module. Physical hardware, audible synthesis, keyboard, and braille remain separate live checks.
This commit is contained in:
1 parent
0dd8e2f9c7
commit
24840d355c
9 files changed
+43
-272
No files matched your search
@@ -3,17 +3,19 @@
|
||||
|
||||
package presentation
|
||||
|
||||
import "unicode"
|
||||
import (
|
||||
"unicode"
|
||||
|
||||
// Phonetic_letter matches Python Fenrir's alphabet, including its capitalization.
|
||||
"git.stormux.org/storm/screenreader-common/phonetic"
|
||||
)
|
||||
|
||||
// Phonetic_letter matches the shared spelling alphabet with Fenrir capitalization.
|
||||
// Other runes use the active punctuation profile's character naming instead.
|
||||
func Phonetic_letter(char rune) string {
|
||||
words := [...]string{"alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whisky", "x ray", "yankee", "zulu"}
|
||||
upper := unicode.ToUpper(char)
|
||||
if upper < 'A' || upper > 'Z' {
|
||||
word := phonetic.Letter(char)
|
||||
if word == "" {
|
||||
return ""
|
||||
}
|
||||
word := words[upper-'A']
|
||||
if unicode.IsUpper(char) {
|
||||
word = string(unicode.ToUpper(rune(word[0]))) + word[1:]
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ func TestPythonPhoneticNamesAndUnicodeFallback(t *testing.T) {
|
||||
want string
|
||||
}{
|
||||
{'a', "alpha"}, {'A', "Alpha"}, {'j', "juliet"},
|
||||
{'w', "whisky"}, {'W', "Whisky"}, {'x', "x ray"}, {'X', "X ray"},
|
||||
{'w', "whiskey"}, {'W', "Whiskey"}, {'x', "x ray"}, {'X', "X ray"},
|
||||
{'É', ""}, {'界', ""}, {'1', ""}, {'?', ""}, {' ', ""},
|
||||
} {
|
||||
if got := Phonetic_letter(trial.char); got != trial.want {
|
||||
|
||||
Reference in new issue
Block a user