frank29259 / thsplitlib
thai word split library
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 29
pkg:composer/frank29259/thsplitlib
Requires
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: 9.4.0
This package is auto-updated.
Last update: 2025-12-26 15:57:02 UTC
README
Lib ตัดคำภาษาไทย สำหรับ PHP ทดลองใช้กับ MPDF
การใช้งาน:
$words = $segment->get_segment_array($text); $text = implode("|",$words);
Config:
$mpdf->useDictionaryLBR = false;
Edit Mpdf.php ค้นหา 3) Break at SPACE:
if ($prevchar == '|') { $breakfound = [$contentctr, $charctr, $cutcontentctr, $cutcharctr, 'discard']; }
Edit Mpdf.php ค้นหา // Selected OBJECTS are moved forward to next line, unless they come before a space or U+200B (type='discard'):
/* -- END OTL -- */ $currContent = str_replace('|','',$currContent);
Edit Mpdf.php ค้นหา // another character will fit, so add it on:
$currContent = str_replace('|','',$currContent); unset($content); unset($contentB);
Credits