-
Notifications
You must be signed in to change notification settings - Fork 1
/
punctuation.lua
executable file
·50 lines (49 loc) · 1.34 KB
/
punctuation.lua
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
#!/usr/bin/lua
-- Copyright 2014 Usmar A. Padow (amigojapan) [email protected]
-- Table of puctuation pronounciation
punctuation={}
punctuation["\\"]="back slash"
punctuation["!"]="exclamation mark"
punctuation["#"]="hash"
punctuation["$"]="dollar"
punctuation["%"]="percent"
punctuation["&"]="and sign"
punctuation["'"]="single quote"
punctuation["\""]="quote"
punctuation["("]="open parenthesis"
punctuation[")"]="close parenthesis"
punctuation["-"]="minus"
punctuation["="]="equal"
punctuation["^"]="carrot"
punctuation["~"]="tilde"
punctuation["¥"]="Yen"
punctuation["|"]="or sign"
punctuation["@"]="at"
punctuation["`"]="back tick"
punctuation["["]="open bracket"
punctuation["]"]="close bracket"
punctuation["{"]="open curly brace"
punctuation["}"]="close curly brace"
punctuation[";"]="semi colon"
punctuation[":"]="colon"
punctuation["+"]="plus"
punctuation["*"]="asterisk"
punctuation[","]="comma"
punctuation["."]="dot"
punctuation[">"]="more than"
punctuation["<"]="less than"
punctuation["/"]="foward slash"
punctuation["?"]="question mark"
punctuation["_"]="underscore"
function convert_punctuation_to_words(str,sayPunctuation,spaces)
if spaces then
str = string.gsub(str,"%s+"," Space ")
end
if sayPunctuation then
for mark, word in pairs(punctuation) do
str = string.gsub(str,"%" .. mark," " .. word.. " ")
end
end
--print(str)
return str
end