frank29259/thsplitlib

thai word split library

1.3 2021-01-26 04:00 UTC

This package is auto-updated.

Last update: 2025-04-26 14:07:29 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