Skip to content

Commit 404e402

Browse files
committed
Update morse.py
1 parent 2899ad8 commit 404e402

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pythainlp/util/morse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'จ': '-..-.',
1111
'ฉ': '----',
1212
'ช': '-..-',
13-
'ฌ':'-..-',
13+
'ฌ': '-..-',
1414
'ซ': '--..',
1515
'ญ': '.---',
1616
'ด': '-..',
@@ -119,7 +119,7 @@
119119
'(': '-.--.-'
120120
}
121121

122-
decodingeng = {} #สร้าง Dictionary สำหรับใช้ถอดรหัสมอร์สภาษาอังกฤษ
122+
decodingeng = {}
123123
for key, val in ENGLISH_MORSE_CODE.items():
124124
decodingeng[val] = key
125125
decodingthai = {}
@@ -129,7 +129,7 @@
129129
THAI_MORSE_CODE[key] = val.replace(" ","")
130130

131131

132-
def morse_encode(text: str, lang: str="th") -> str:
132+
def morse_encode(text: str, lang: str = "th") -> str:
133133
"""
134134
Convert text to Morse code (support Thai and English)
135135
@@ -167,7 +167,7 @@ def morse_encode(text: str, lang: str="th") -> str:
167167
raise NotImplementedError(f"This function doesn't support {lang}.")
168168

169169

170-
def morse_decode(morse_text: str, lang: str="th") -> str:
170+
def morse_decode(morse_text: str, lang: str = "th") -> str:
171171
"""
172172
Simple Convert Morse code to text
173173

0 commit comments

Comments
 (0)