Skip to content

Commit c058102

Browse files
committed
Update command line doc
1 parent b70ee14 commit c058102

2 files changed

Lines changed: 43 additions & 25 deletions

File tree

docs/notes/command_line.rst

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,74 @@
11
Command Line
22
============
33

4-
You can use PyThaiNLP from Command Line.
4+
You can use some thainlp functions directly from command line.
55

6-
Run Command Line and type the commands:::
6+
**Tokenization**::
77

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
139

1410
*Example*::
1511

1612
$ thainlp tokenize word สภาพการจ้างและสภาพการทำงาน
1713
สภาพการจ้าง|และ|สภาพ|การทำงาน|
1814

19-
**Syllable tokenization**::
20-
21-
thainlp tokenize syllable TEXT
22-
23-
*Example*::
24-
2515
$ thainlp tokenize syllable สภาพการจ้างและสภาพการทำงาน
2616
สภาพ~การ~จ้าง~และ~สภาพ~การ~ทำ~งาน~
2717

28-
**Subword tokenization**::
29-
30-
thainlp tokenize subword TEXT
31-
32-
*Example*::
33-
3418
$ thainlp tokenize subword สภาพการจ้างและสภาพการทำงาน
3519
ส/ภา/พ/กา/ร/จ้า/ง/และ/ส/ภา/พ/กา/ร/ทำ/งา/น/
3620

21+
$ thainlp tokenize word -a longest "แรงงานกะดึก: ฟันเฟืองที่ยังหมุนในคำ่คืนมีเคอร์ฟิว"
22+
แรงงาน|กะ|ดึก|:| |ฟันเฟือง|ที่|ยัง|หมุน|ใน|คำ่|คืน|มี|เคอร์ฟิว|
23+
24+
$ thainlp tokenize word -nw -s # "5 เหตุผล 'ไม่ควร' ต่อพ.ร.ก.ฉุกเฉิน"
25+
5#เหตุผล#'#ไม่#ควร#'#ต่อ#พ.ร.ก.#ฉุกเฉิน#
26+
3727
**Part-Of-Speech tagging**::
3828

39-
pythainlp tagg pos -s SEPARATOR TEXT
29+
pythainlp tagg pos [-s SEPARATOR] TEXT
4030

4131
*Example*::
4232

4333
$ thainlp tag pos -s . ผม.ไม่.กิน.เผ็ด
4434

4535
**Soundex**::
4636

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>
4853

4954
*Example*::
5055

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
5365

54-
**Mange corpus**::
66+
$ thainlp data get thai2fit_wv
67+
Corpus: thai2fit_wv
68+
- Downloading: thai2fit_wv 0.1
69+
36%|█████████████████▉ |
5570

56-
thainlp data
71+
$ thainlp data --help
5772

5873
**Help**::
5974

docs/notes/installation.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,8 @@ Runtime Configurations
5050
This environment variable specifies the location where the downloaded data
5151
and the corpus database information are stored. If this directory
5252
does not exist, PyThaiNLP will automatically create a new one.
53+
5354
By default, it is specified to the directory called ``pythainlp-data``
5455
within the home directory.
56+
57+
Type `thainlp data path` at command line to see current PYTHAINLP_DATA_DIR.

0 commit comments

Comments
 (0)