Skip to main content
`Ctrl`+`K`

# 7.8.18. `TokenTrigram`

## 7.8.18.1. Summary

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

## 7.8.18.2. Syntax

`TokenTrigram` hasn’t parameter:

    TokenTrigram

## 7.8.18.3. Usage

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

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

Execution example:

    tokenize TokenTrigram "日本語の勉強" NormalizerAuto
    # [
    #   [
    #     0,
    #     1337566253.89858,
    #     0.000355720520019531
    #   ],
    #   [
    #     {
    #       "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
    #     }
    #   ]
    # ]