Skip to content

Commit fab0501

Browse files
committed
Thai alphabet, v0.4.0
1 parent 19f6462 commit fab0501

File tree

4 files changed

+29
-34
lines changed

4 files changed

+29
-34
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ Currently, as a major drawback, Chinese characters are missing. Someone with the
100100
[Chinese telegraph code](https://en.wikipedia.org/wiki/Chinese_telegraph_code) can help to implement it. Also someone who is proficient in Thai can help
101101
to include [Thai alphabet](https://th.wikipedia.org/wiki/รหัสมอร์ส).
102102

103+
## Generating Minified Files
104+
105+
Install node and npm following one of the techniques explained within
106+
this [link](https://gist.github.com/isaacs/579814) and run the commands below.
107+
108+
``` bash
109+
$ npm install --global gulp-cli
110+
$ npm install
111+
$ gulp
112+
```
113+
103114
## License
104115
The MIT License (MIT). Please see [License File](LICENSE) for more information.
105116

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "morsify",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Morse code translator and decoder which also generates audio.",
55
"keywords": [
66
"morse",

src/morsify.js

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -89,38 +89,22 @@
8989
'ㅗ': '01', 'ㅛ': '10', 'ㅜ': '0000', 'ㅠ': '010', 'ㅡ': '100', 'ㅣ': '001'
9090
},
9191
'12' : { // Thai Alphabet => https://th.wikipedia.org/wiki/รหัสมอร์ส
92-
// characters
93-
'ก': '110',
94-
'ข': '1010', // 'ฃ': '1010', => duplicated with ข
95-
'ค': '101', // 'ฅ': '101', 'ฆ': '101', => duplicated with ค
96-
'ง': '10110',
97-
'จ': '10010', 'ฉ': '1111', 'ช': '1001', 'ซ': '1100', 'ญ': '0111',
98-
'ด': '100', //'ฎ': '100', => duplicated with ด
99-
'ต': '1', //'ฏ': '1', => duplicated with ต
100-
'ถ': '10100', //'ฐ': '10100', => duplicated with ถ
101-
'ท': '10011', //'ธ': '10011', 'ฑ': '10011', 'ฒ': '10011', => duplicated with ท
102-
'น': '10', //'ณ': '10', => duplicated with ณ
103-
'บ': '1000', 'ป': '0110', 'ผ':'1101', 'ฝ': '10101',
104-
'พ': '01100', //'ภ': '01100', => duplicated with พ
105-
'ฟ': '0010', 'ม': '11', 'ย': '1011', 'ร': '010',
106-
'ล': '0100', //'ฬ': '0100', => duplicated with ล
107-
'ว': '011',
108-
'ส': '000', // 'ษ': '000', 'ศ': '000', => duplicated with ส
109-
'ห': '0000', 'อ': '10001', 'ฮ': '11011',
110-
'ฤ': '01011', //'ฤๅ': '01011', => duplicated with ฤ
111-
112-
// vowels
113-
'ะ': '01000', 'า': '01', 'ิ': '00100', 'ี': '00', 'ึ': '00110', 'ื': '0011', 'ุ': '00101', 'ู': '1110',
114-
'เ': '0', 'แ': '0101',
115-
'ไ': '01001', //'ใ': '01001', => duplicated with ไ
116-
'โ': '111', 'ำ': '00010',
117-
118-
// tone marks
119-
'่': '001', '้': '0001', '๊': '11000', '๋':'01010',
120-
121-
// special marks
122-
'ั': '01101', '็': '11100', '์': '11001', 'ๆ': '10111',
123-
'ฯ': '11010', // 'ฯลฯ': '11101' => conflicts with ฯ
92+
'ก': '110', 'ข': '1010', 'ค': '101', 'ง': '10110', 'จ': '10010',
93+
'ฉ': '1111', 'ช': '1001', 'ซ': '1100', 'ญ': '0111', 'ด': '100',
94+
'ต': '1', 'ถ': '10100', 'ท': '10011', 'น': '10', 'บ': '1000',
95+
'ป': '0110', 'ผ':'1101', 'ฝ': '10101', 'พ': '01100', 'ฟ': '0010',
96+
'ม': '11', 'ย': '1011', 'ร': '010', 'ล': '0100', 'ว': '011',
97+
'ส': '000', 'ห': '0000', 'อ': '10001', 'ฮ': '11011', 'ฤ': '01011',
98+
'ะ': '01000', 'า': '01', 'ิ': '00100', 'ี': '00', 'ึ': '00110',
99+
'ื': '0011', 'ุ': '00101', 'ู': '1110', 'เ': '0', 'แ': '0101',
100+
'ไ': '01001', 'โ': '111', 'ำ': '00010', '่': '001', '้': '0001',
101+
'๊': '11000', '๋':'01010', 'ั': '01101', '็': '11100', '์': '11001',
102+
'ๆ': '10111', 'ฯ': '11010',
103+
// duplicates
104+
// 'ฃ': '1010', => duplicated with ข | 'ฅ': '101', 'ฆ': '101', => duplicated with ค | 'ฎ': '100', => duplicated with ด
105+
// 'ฏ': '1', => duplicated with ต | 'ฐ': '10100', => duplicated with ถ | 'ธ': '10011', 'ฑ': '10011', 'ฒ': '10011', => duplicated with ท
106+
// 'ณ': '10', => duplicated with ณ | 'ภ': '01100', => duplicated with พ | 'ฬ': '0100', => duplicated with ล
107+
// 'ษ': '000', 'ศ': '000', => duplicated with ส | 'ฤๅ': '01011', => duplicated with ฤ | 'ใ': '01001', => duplicated with ไ | 'ฯลฯ': '11101' => conflicts with ฯ
124108
}
125109
};
126110

test/morsify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('morsify', function () {
159159
t.equal(morsify.decode('.-/-./..../.-./-../..-', options), 'ㅗ ㅛ ㅜ ㅠ ㅡ ㅣ');
160160
});
161161
it('encodes thai alphabet', function () {
162-
var options = { priority: 11 };
162+
var options = { priority: 12 };
163163
t.equal(morsify.encode('กขคง', options), '--./-.-./-.-/-.--.');
164164
t.equal(morsify.encode('จฉชซญด', options), '-..-./----/-..-/--../.---/-..');
165165
t.equal(morsify.encode('ตถทนบ', options), '-/-.-../-..--/-./-...');

0 commit comments

Comments
 (0)