|
1 | 1 | Command Line |
2 | 2 | ============ |
3 | 3 |
|
4 | | -You can use PyThaiNLP from Command Line. |
| 4 | +You can use some thainlp functions directly from command line. |
5 | 5 |
|
6 | | -Run Command Line and type the commands::: |
| 6 | +**Tokenization**:: |
7 | 7 |
|
8 | | - thainlp |
9 | | - |
10 | | -**Word tokenization**:: |
11 | | - |
12 | | - thainlp tokenize word TEXT |
| 8 | + thainlp tokenize <word|syllable|subword|sent> [-w] [-nw] [-a newmm|attacut|longest] [-s SEPARATOR] TEXT |
13 | 9 |
|
14 | 10 | *Example*:: |
15 | 11 |
|
16 | 12 | $ thainlp tokenize word สภาพการจ้างและสภาพการทำงาน |
17 | 13 | สภาพการจ้าง|และ|สภาพ|การทำงาน| |
18 | 14 |
|
19 | | -**Syllable tokenization**:: |
20 | | - |
21 | | - thainlp tokenize syllable TEXT |
22 | | - |
23 | | -*Example*:: |
24 | | - |
25 | 15 | $ thainlp tokenize syllable สภาพการจ้างและสภาพการทำงาน |
26 | 16 | สภาพ~การ~จ้าง~และ~สภาพ~การ~ทำ~งาน~ |
27 | 17 |
|
28 | | -**Subword tokenization**:: |
29 | | - |
30 | | - thainlp tokenize subword TEXT |
31 | | - |
32 | | -*Example*:: |
33 | | - |
34 | 18 | $ thainlp tokenize subword สภาพการจ้างและสภาพการทำงาน |
35 | 19 | ส/ภา/พ/กา/ร/จ้า/ง/และ/ส/ภา/พ/กา/ร/ทำ/งา/น/ |
36 | 20 |
|
| 21 | + $ thainlp tokenize word -a longest "แรงงานกะดึก: ฟันเฟืองที่ยังหมุนในคำ่คืนมีเคอร์ฟิว" |
| 22 | + แรงงาน|กะ|ดึก|:| |ฟันเฟือง|ที่|ยัง|หมุน|ใน|คำ่|คืน|มี|เคอร์ฟิว| |
| 23 | + |
| 24 | + $ thainlp tokenize word -nw -s # "5 เหตุผล 'ไม่ควร' ต่อพ.ร.ก.ฉุกเฉิน" |
| 25 | + 5#เหตุผล#'#ไม่#ควร#'#ต่อ#พ.ร.ก.#ฉุกเฉิน# |
| 26 | + |
37 | 27 | **Part-Of-Speech tagging**:: |
38 | 28 |
|
39 | | - pythainlp tagg pos -s SEPARATOR TEXT |
| 29 | + pythainlp tagg pos [-s SEPARATOR] TEXT |
40 | 30 |
|
41 | 31 | *Example*:: |
42 | 32 |
|
43 | 33 | $ thainlp tag pos -s . ผม.ไม่.กิน.เผ็ด |
44 | 34 |
|
45 | 35 | **Soundex**:: |
46 | 36 |
|
47 | | - thainlp soundex TEXT |
| 37 | + thainlp soundex [-a udom83|lk82|metasound] TEXT |
| 38 | + |
| 39 | +*Example*:: |
| 40 | + |
| 41 | + $ thainlp soundex วรรณ |
| 42 | + ว330000 |
| 43 | + |
| 44 | + $ thainlp soundex -a lk82 วัน |
| 45 | + ว4000 |
| 46 | + |
| 47 | + $ thainlp soundex -a lk82 วรรณ |
| 48 | + ว4000 |
| 49 | + |
| 50 | +**Corpus management**:: |
| 51 | + |
| 52 | + thainlp data <catalog|info|get|rm|path> |
48 | 53 |
|
49 | 54 | *Example*:: |
50 | 55 |
|
51 | | - $ thainlp soundex บรรณการ |
52 | | - บ319000 |
| 56 | + $ thainlp data path |
| 57 | + /Users/user1/pythainlp-data |
| 58 | + |
| 59 | + $ thainlp data catalog |
| 60 | + Dataset/corpus available for download: |
| 61 | + - crfcut 0.1 |
| 62 | + - thai-g2p 0.1 (Local: 0.1) |
| 63 | + - thai2fit_wv 0.1 |
| 64 | + - thainer-1-3 1.3 |
53 | 65 |
|
54 | | -**Mange corpus**:: |
| 66 | + $ thainlp data get thai2fit_wv |
| 67 | + Corpus: thai2fit_wv |
| 68 | + - Downloading: thai2fit_wv 0.1 |
| 69 | + 36%|█████████████████▉ | |
55 | 70 |
|
56 | | - thainlp data |
| 71 | + $ thainlp data --help |
57 | 72 |
|
58 | 73 | **Help**:: |
59 | 74 |
|
|
0 commit comments