-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.ps1
60 lines (54 loc) · 1.5 KB
/
script.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/opt/pwsh/pwsh
While($True) {
$plate = Read-Host "Please enter a standard Hungarian car license plate (AAA-000)"
if ($plate -match "[A-Z]{3}`-\d{3}") { break }
}
$letters=($plate -split "-")[0]
$numbers=($plate -split "-")[1]
$spellout=""
$letters.toCharArray() |% {
switch($_){
'A' { $spellout+="alpha " }
'B' { $spellout+="bra vow " }
'C' { $spellout+="charlie " }
'D' { $spellout+="delta "}
'E' { $spellout+="eko" }
'F' { $spellout+="fuxtrut " }
'G' { $spellout+="golf " }
'H' { $spellout+="hotel " }
'I' { $spellout+="india " }
'J' { $spellout+="jewleeat " }
'K' { $spellout+="keelow " }
'L' { $spellout+="leemuh " }
'M' { $spellout+="mike " }
'N' { $spellout+="november " }
'O' { $spellout+="oscar " }
'P' { $spellout+="puhpuh " }
'Q' { $spellout+="kehbeck " }
'R' { $spellout+="rowmio " }
'S' { $spellout+="siairuh " }
'T' { $spellout+="tahgo " }
'U' { $spellout+="uniform " }
'V' { $spellout+="victor " }
'W' { $spellout+="whiskey " }
'X' { $spellout+="x-ray " }
'Y' { $spellout+="yangkey " }
'Z' { $spellout+="zoo loo " }
}
}
$spellout += ",DASH. "
$numbers.toCharArray() |% {
switch($_) {
'0' { $spellout+="nuhduh-zayro " }
'1' { $spellout+="oonuhwun " }
'2' { $spellout+="beessohtoo " }
'3' { $spellout+="tayrutree " }
'4' { $spellout+="kartayfower " }
'5' { $spellout+="puhntuh5 " }
'6' { $spellout+="soksee6 " }
'7' { $spellout+="sattah7 " }
'8' { $spellout+="okto8 " }
'9' { $spellout+="novay9er " }
}
}
$spellout | .\stspeech | out-null