Update char_utils.py
This commit is contained in:
parent
feeb323ce7
commit
d46b37b4e1
@ -36,3 +36,19 @@ def getNextChar(currX,currY, currText):
|
||||
x += 1
|
||||
currChar = wrappedLines[y][x]
|
||||
return x, y, currChar
|
||||
|
||||
def getPhonetic(currChar):
|
||||
if len(currChar) != 1:
|
||||
return currChar
|
||||
phoneticsDict = {
|
||||
"A":"alpha", "B":"bravo", "C":"charlie", "D":"delta", "E":"echo",
|
||||
"F":"foxtrot", "G":"golf", "H":"hotel", "I":"india", "J":"juliet",
|
||||
"K":"kilo", "L":"lima", "M":"mike", "N":"november", "O":"oscar",
|
||||
"P":"papa", "Q":"quebec", "R":"romeo", "S":"sierra", "T":"tango",
|
||||
"U":"uniform", "V":"victor", "W":"whisky", "X":"x ray",
|
||||
"Y":"yankee", "Z":"zulu"
|
||||
}
|
||||
try:
|
||||
return phoneticsDict[currChar.upper()]
|
||||
except:
|
||||
return currChar
|
||||
|
Loading…
Reference in New Issue
Block a user