After commit c018f5fd29 Fenrir is being switched over to go. If you do not want to be part of the testing process, please switch to master.
This commit is contained in:
1 parent
c018f5fd29
commit
0e50de4c76
1047 files changed
+58364
-63747
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2026 Storm Dragon
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package presentation
|
||||
|
||||
import "unicode"
|
||||
|
||||
// Phonetic_letter matches Python Fenrir's alphabet, including its 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' {
|
||||
return ""
|
||||
}
|
||||
word := words[upper-'A']
|
||||
if unicode.IsUpper(char) {
|
||||
word = string(unicode.ToUpper(rune(word[0]))) + word[1:]
|
||||
}
|
||||
return word
|
||||
}
|
||||
Reference in new issue
Block a user