minh7721/vietnamese-related-words

Make related words from vietnamese string

1.0.1 2024-05-06 08:58 UTC

This package is auto-updated.

Last update: 2024-11-06 10:02:54 UTC


README

    composer require nguyenhiep/vietnamese-related-words

Configuration

To configure the package you need to publish settings first:

    php artisan vendor:publish --provider="Nguyenhiep\VietnameseRelatedWords\VietnameseRelatedWordsServiceProvider"

Usage

    $analyer = new Nguyenhiep\VietnameseRelatedWords\VietnameseAnalyzer();
    //using vncorenlp
    $analyer->vncorenlp("một chuỗi tiếng việt"); //["chuỗi tiếng","một chuỗi","chuỗi tiếng việt",]
    //using coccoc tokenizer
    $analyer->es_analyze("một chuỗi tiếng việt"); //["một","chuỗi","tiếng việt",]
    //using  VnTokenizer library
    $analyer->es_analyze("một chuỗi tiếng việt"); //["một","chuỗi","tiếng","việt",]

Notice:

- if you want to see analying results, add param `true` to analyer construct

- if you want to add more mapping rules, add them in `vietnamese-related-words.php`

Reference