Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChinaStemmingTokenizer #6

Open
BadDeveloper2022 opened this issue Aug 1, 2023 · 0 comments
Open

ChinaStemmingTokenizer #6

BadDeveloper2022 opened this issue Aug 1, 2023 · 0 comments
Assignees

Comments

@BadDeveloper2022
Copy link

BadDeveloper2022 commented Aug 1, 2023

`<?php
namespace VFou\Search\Tokenizers;
use Lizhichao\Word\VicWord;
class ChinaStemmingTokenizer implements TokenizerInterface
{
public static function tokenize($data)
{

    $fc = new VicWord();
    return array_map(function ($value) use ($fc) {
        $arr = $fc->getAutoWord($value);
        $newItems = [];
        foreach ($arr as $key => $val) {
            $newItems[] = $val[0];
        }
        return $newItems;
    }, $data);
}

}
`
https://github.com/lizhichao/VicWord
composer require lizhichao/word


The Chinese word segmentation database has no problem with word segmentation.
But when searching, a list that should not appear appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants