toanld/vietnamese-related-words

Make related words from vietnamese string

v1.0.2 2023-10-05 01:36 UTC

This package is auto-updated.

Last update: 2024-11-05 04:05:50 UTC


README

    composer require toanld/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