7.8.18. TokenUnigram — Groonga v9.1.1-76-g53aa7c4 documentation

# groonga - An open-source fulltext search engine and column store.

- 日本語

# 7.8.18. `TokenUnigram`

## 7.8.18.1. Summary

`TokenUnigram` is similar to TokenBigram. The differences between them is token unit.

## 7.8.18.2. Syntax

`TokenUnigram` hasn’t parameter:

    TokenUnigram

## 7.8.18.3. Usage

If normalizer is used, `TokenUnigram` uses white-space-separate like tokenize method for ASCII characters. `TokenUnigram` uses unigram tokenize method for non-ASCII characters.

If `TokenUnigram` tokenize non-ASCII charactors, `TokenUnigram` uses 1 character per token as below example.

Execution example:

    tokenize TokenUnigram "日本語の勉強" NormalizerAuto
    # [
    #   [
    #     0,
    #     1546584495.218799,
    #     0.0002140998840332031
    #   ],
    #   [
    #     {
    #       "value": "日",
    #       "position": 0,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     },
    #     {
    #       "value": "本",
    #       "position": 1,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     },
    #     {
    #       "value": "語",
    #       "position": 2,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     },
    #     {
    #       "value": "の",
    #       "position": 3,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     },
    #     {
    #       "value": "勉",
    #       "position": 4,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     },
    #     {
    #       "value": "強",
    #       "position": 5,
    #       "force_prefix": false,
    #       "force_prefix_search": false
    #     }
    #   ]
    # ]