guideline: linguist review (PR #1 of khammoon-dev)
Browse files
guideline/linguistic_guideline.md
CHANGED
|
@@ -14,8 +14,12 @@ Apply these steps sequentially for every input.
|
|
| 14 |
|
| 15 |
**Step 1: Structural-level segmentation**
|
| 16 |
Split the text by syntactic/functional chunks. Preserve whitespace exactly.
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
Input: ว้าย นั่นใคร
|
| 21 |
Output: ว้าย| |นั่น|ใคร
|
|
@@ -43,11 +47,9 @@ Output: ว้าย| |นั่น|ใคร
|
|
| 43 |
Output: 3)| |นาง|สมร
|
| 44 |
Input: บทความที่ (๒) ระบุว่า
|
| 45 |
Output: บท|ความ|ที่| |(๒)| |ระบุ|ว่า
|
| 46 |
-
*
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
Input: [(18*67)+15]-17^2 = ~42.22
|
| 50 |
-
Output: [|(|18|*|67|)|+|15|]|-|17|^|2| |=| |~|42.22
|
| 51 |
|
| 52 |
* **SPLIT (Separate into individual tokens):**
|
| 53 |
* Foreign-language text (split on whitespace)
|
|
@@ -57,22 +59,30 @@ Output: ว้าย| |นั่น|ใคร
|
|
| 57 |
Output: the| |4th| |generation
|
| 58 |
Input: People's Alliance for Democracy
|
| 59 |
Output: People's| |Alliance| |for| |Democracy
|
|
|
|
|
|
|
| 60 |
* Punctuation (parentheses, quotes)
|
| 61 |
Input: บดินทรเดชา (สิงห์ สิงหเสนี)
|
| 62 |
Output: บดินทรเดชา| |(|สิงห์| |สิงหเสนี|)
|
| 63 |
Input: เขาร้องว่า “ช่วยด้วย”
|
| 64 |
Output: เขา|ร้อง|ว่า| |“|ช่วย|ด้วย|”
|
| 65 |
* Symbols (%, #, etc.) separated from adjacent text
|
| 66 |
-
Input:
|
| 67 |
-
Output:
|
| 68 |
Input: #วันหยุด #ทะเล
|
| 69 |
Output: #|วัน|หยุด| |#|ทะเล
|
| 70 |
Input: ไม่มีอีกแล้ว.... เงินเก็บ
|
| 71 |
Output: ไม่|มี|อีก|แล้ว|.|.|.|.| |เงิน|เก็บ
|
| 72 |
-
Input: บริษัท Yahoo! มี
|
| 73 |
-
Output: บริษัท| |Yahoo|!| |มี|
|
| 74 |
Input: ลดราคา 25%
|
| 75 |
Output: ลด|ราคา| |25|%
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
**Step 3: Thai-character handling**
|
| 78 |
* **3.1 Assume correct orthography:** Segment based on intended valid spelling.
|
|
@@ -132,8 +142,12 @@ Evaluate each remaining chunk. Stop at the first category that applies.
|
|
| 132 |
Output: ซุป|กิมจิ
|
| 133 |
Input: คุณค่าของราชวังเก่า
|
| 134 |
Output: คุณ|ค่า|ของ|ราช|วัง|เก่า
|
| 135 |
-
Input:
|
| 136 |
-
Output:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
* **Category 2: All Pali-Sanskrit**
|
| 139 |
* True สมาส-สนธิ (Meaning flows back->front): KEEP.
|
|
@@ -145,11 +159,6 @@ Evaluate each remaining chunk. Stop at the first category that applies.
|
|
| 145 |
Output: พุทธศาสนา
|
| 146 |
Input: มหาบัณฑิต
|
| 147 |
Output: มหาบัณฑิต
|
| 148 |
-
* สมาสเทียม (Contains non P-S parts): SPLIT.
|
| 149 |
-
Input: เวชระเบียน
|
| 150 |
-
Output: เวช|ระเบียน
|
| 151 |
-
Input: พลเมือง
|
| 152 |
-
Output: พล|เมือง
|
| 153 |
* Thai-syntax order (front->back) or คำซ้อน: SPLIT.
|
| 154 |
Input: ศาสนาพุทธ
|
| 155 |
Output: ศ���สนา|พุทธ
|
|
@@ -180,7 +189,7 @@ Evaluate each remaining chunk. Stop at the first category that applies.
|
|
| 180 |
Output: มะพร้าว
|
| 181 |
Input: กินมะม่วงกะมะพร้าว
|
| 182 |
Output: กิน|มะม่วง|กะ|มะพร้าว
|
| 183 |
-
* **4-B Meaningless affix syllables: SPLIT (unless it is a fused prefix like ระ-, กระ-).**
|
| 184 |
Input: ตาเตอ
|
| 185 |
Output: ตา|เตอ
|
| 186 |
Input: ร้อนเริ้น
|
|
|
|
| 14 |
|
| 15 |
**Step 1: Structural-level segmentation**
|
| 16 |
Split the text by syntactic/functional chunks. Preserve whitespace exactly.
|
| 17 |
+
|
| 18 |
+
Input: แม่ฝากฉันซื้อปลา แต่ตลาดปิด
|
| 19 |
+
Output: แม่|ฝาก|ฉัน|ซื้อ|ปลา| |แต่|ตลาด|ปิด
|
| 20 |
+
|
| 21 |
+
Input: ลลิษา มโนบาลเป็นไอดอลสาวชาวไทย
|
| 22 |
+
Output: ลลิษา| |มโนบาล|เป็น|ไอดอล|สาว|ชาว|ไทย
|
| 23 |
|
| 24 |
Input: ว้าย นั่นใคร
|
| 25 |
Output: ว้าย| |นั่น|ใคร
|
|
|
|
| 47 |
Output: 3)| |นาง|สมร
|
| 48 |
Input: บทความที่ (๒) ระบุว่า
|
| 49 |
Output: บท|ความ|ที่| |(๒)| |ระบุ|ว่า
|
| 50 |
+
* Chemical compounds
|
| 51 |
+
Input: Ca(OH)2 + CO2
|
| 52 |
+
Output: Ca(OH)2| |+| |CO2
|
|
|
|
|
|
|
| 53 |
|
| 54 |
* **SPLIT (Separate into individual tokens):**
|
| 55 |
* Foreign-language text (split on whitespace)
|
|
|
|
| 59 |
Output: the| |4th| |generation
|
| 60 |
Input: People's Alliance for Democracy
|
| 61 |
Output: People's| |Alliance| |for| |Democracy
|
| 62 |
+
Input: That’s bad
|
| 63 |
+
Output: That’s| |bad
|
| 64 |
* Punctuation (parentheses, quotes)
|
| 65 |
Input: บดินทรเดชา (สิงห์ สิงหเสนี)
|
| 66 |
Output: บดินทรเดชา| |(|สิงห์| |สิงหเสนี|)
|
| 67 |
Input: เขาร้องว่า “ช่วยด้วย”
|
| 68 |
Output: เขา|ร้อง|ว่า| |“|ช่วย|ด้วย|”
|
| 69 |
* Symbols (%, #, etc.) separated from adjacent text
|
| 70 |
+
Input: มีขยะเพิ่มเป็น 25.50%
|
| 71 |
+
Output: มี|ขยะ|เพิ่ม|เป็น| |25.50|%
|
| 72 |
Input: #วันหยุด #ทะเล
|
| 73 |
Output: #|วัน|หยุด| |#|ทะเล
|
| 74 |
Input: ไม่มีอีกแล้ว.... เงินเก็บ
|
| 75 |
Output: ไม่|มี|อีก|แล้ว|.|.|.|.| |เงิน|เก็บ
|
| 76 |
+
Input: บริษัท Yahoo! มีกำไร $300,000-400,000
|
| 77 |
+
Output: บริษัท| |Yahoo|!| |มี|กำไร| |$|300,000|-|400,000
|
| 78 |
Input: ลดราคา 25%
|
| 79 |
Output: ลด|ราคา| |25|%
|
| 80 |
+
* Mathematical/chemical symbols (+, -, =, ~, ^, --->, etc.) separated from adjacent text
|
| 81 |
+
Input: Ca(OH)2 + CO2 ---> CaCO3 + H2O + heat
|
| 82 |
+
Output: Ca(OH)2| |+| |CO2| |--->| |CaCO3| |+| |H2O| |+| |heat
|
| 83 |
+
Input: [(18*67)+15]-17^2 = ~42.22
|
| 84 |
+
Output: [|(|18|*|67|)|+|15|]|-|17|^|2| |=| |~|42.22
|
| 85 |
+
|
| 86 |
|
| 87 |
**Step 3: Thai-character handling**
|
| 88 |
* **3.1 Assume correct orthography:** Segment based on intended valid spelling.
|
|
|
|
| 142 |
Output: ซุป|กิมจิ
|
| 143 |
Input: คุณค่าของราชวังเก่า
|
| 144 |
Output: คุณ|ค่า|ของ|ราช|วัง|เก่า
|
| 145 |
+
Input: อุตสาหกรรมเคมีภัณฑ์
|
| 146 |
+
Output: อุตสาหกรรม|เคมี|ภัณฑ์
|
| 147 |
+
Input: เวชระเบียน
|
| 148 |
+
Output: เวช|ระเบียน
|
| 149 |
+
Input: พลเมือง
|
| 150 |
+
Output: พล|เมือง
|
| 151 |
|
| 152 |
* **Category 2: All Pali-Sanskrit**
|
| 153 |
* True สมาส-สนธิ (Meaning flows back->front): KEEP.
|
|
|
|
| 159 |
Output: พุทธศาสนา
|
| 160 |
Input: มหาบัณฑิต
|
| 161 |
Output: มหาบัณฑิต
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
* Thai-syntax order (front->back) or คำซ้อน: SPLIT.
|
| 163 |
Input: ศาสนาพุทธ
|
| 164 |
Output: ศ���สนา|พุทธ
|
|
|
|
| 189 |
Output: มะพร้าว
|
| 190 |
Input: กินมะม่วงกะมะพร้าว
|
| 191 |
Output: กิน|มะม่วง|กะ|มะพร้าว
|
| 192 |
+
* **4-B Meaningless affix syllables: SPLIT (unless it is a fused prefix like ระ-, กระ-, ประ-).**
|
| 193 |
Input: ตาเตอ
|
| 194 |
Output: ตา|เตอ
|
| 195 |
Input: ร้อนเริ้น
|