frank29259/thsplitlib

泰语单词分割库

1.3 2021-01-26 04:00 UTC

This package is auto-updated.

Last update: 2024-09-26 13:00:08 UTC


README

Lib ตัดคำภาษาไทย สำหรับ PHP ทดลองใช้กับ MPDF

使用方法

    $words = $segment->get_segment_array($text);
    $text = implode("|",$words);

配置

    $mpdf->useDictionaryLBR = false;

编辑 Mpdf.php 搜索 3) Break at SPACE

    if ($prevchar == '|') {
        $breakfound = [$contentctr, $charctr, $cutcontentctr, $cutcharctr, 'discard'];
    }

编辑 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); 

编辑 Mpdf.php 搜索 // another character will fit, so add it on

    $currContent = str_replace('|','',$currContent); 
    unset($content);
    unset($contentB);

致谢