บันทึกการเปลี่ยนแปลง
การเปลี่ยนแปลงสำคัญทุกรายการของ kham ตาม Keep a Changelog และ Semantic Versioning
เพิ่มเติม — kham-pg
- kham_fts_dict — custom dictionary template ขยาย token ภาษาไทย/Named แต่ละตัวเป็น lexeme สูงสุด 6 รายการ: คำ normalized, รหัส lk82 Soundex และ RTGS romanization รองรับการค้นหาแบบ phonetic-fuzzy และ Latin-script
- รองรับ ts_headline — callback
kham_headlineลงทะเบียนเป็น HEADLINE function มี 5 regress tests - Named entity token type —
TokenKind::Named(_) → 7ลงทะเบียนในkham_lextypes
แก้ไข — kham-pg
- PG 16+ lexize calling convention — arg3 ใน
kham_dict_lexizeเป็นList*บน PG 16+ ไม่ใช่ bool เดิมทำให้ทุก token ถูก discard เป็น stopword ส่งผลให้ tsvector ว่างเปล่า
เพิ่มเติม
- Thai phonetic encoding — โมดูล
soundex:lk82,udom83,metasound,thai_english_soundex - CLI
--soundex— รหัส phonetic ปรากฏใน fieldsyn=ของ FTS output - Accuracy benchmark —
kham-bench-accuracy: P/R/F1 ระดับขอบเขตคำ,--thresholdCI gate - ขยายข้อมูล — NE gazetteer +17,240 รายการ Wikipedia + +8,980 นามสกุลไทย → 36,600 รายการ POS table +8,691 รายการ ORCHID → ~9,000 รายการ
- ลดขนาด binary — บีบอัด
tnc_freq.txt,ne_th.tsv,pos_th.tsvด้วย zlib ตอน compile time
เปลี่ยนแปลง — breaking
- Compound-first DP scoring — เปลี่ยนลำดับ priority ใน
DpScore: ลด token count มี priority 2 (เหนือกว่าการเพิ่ม dict match) แก้ปัญหา over-segmentation คำประสม Micro F1: 0.418 → 0.975, ประโยคที่ตรงกับ PyThaiNLP newmm: 1/39 → 37/39 (94.9%)
เพิ่มเติม
- โมดูล abbrev —
AbbrevMapพร้อม TSV ในตัว 118 รายการ (เดือน, ยศ, หน่วยงาน, เขตกรุงเทพฯ) ขยายคำย่อก่อนตัดคำแบบ greedy longest-first - โมดูล date — normalize วันที่ภาษาไทย: 7 รูปแบบ input, พ.ศ./ค.ศ., output เป็น ISO 8601
- โมดูล sentence — ตัดประโยคภาษาไทย: ตัวจบประโยคไทย, ไปยาลน้อย, เครื่องหมายสากล, กฎจุดคำนึงถึงทศนิยม/คำย่อ
เพิ่มเติม
- Named Entity Recognition —
NeTagger: gazetteer-based, greedy longest-match, 5 token พร้อมกัน NE gazetteer 10,488 รายการ Person / Place / Org - POS Tagging —
PosTagger: lookup-based, 338 รายการ, 13 หมวดหมู่จาก ORCHID - RTGS Romanization —
RomanizationMap: ตาราง Thai → Roman 415 รายการ - Number normalization — แปลงตัวเลขและข้อความตัวเลขภาษาไทย รวมถึงจำนวนเงินบาท
- SQLite FTS5 extension —
kham-sqlite: pipeline NLP ครบชุด, byte-accurate offsets สำหรับhighlight()และsnippet() - FTS pipeline —
FtsTokenizerbuilder รวม POS, NE, romanization, stopwords, synonym expansion ในรอบเดียว
v0.1.0 – v0.1.3 2026-04-18 – 2026-04-19
v0.1.3 — ชุด pg_regress สำหรับ PostgreSQL: 67 tests ใน 4 suite (kham_fts, kham_thai, kham_operators, kham_ranking)
v0.1.2 — PostgreSQL FTS extension (
kham-pg): parser สำหรับ PG 17, 6 token types, make install + Docker regress โมดูล FTS: stopwords, synonyms, ngramsv0.1.1 — ใบอนุญาต MIT OR Apache-2.0 dual license,
pyproject.toml สำหรับ maturinv0.1.0 — เวอร์ชันแรก: อัลกอริทึม DAG-based newmm, DARTS dictionary, TCC boundary detection, Unicode pre-tokenizer, zero-copy Token, Python (PyO3), WASM (wasm-bindgen), C FFI (cbindgen), CLI, criterion benchmarks