7.8.5. TokenBigramIgnoreBlankSplitSymbolAlpha

7.8.5.1. Summary

TokenBigramIgnoreBlankSplitSymbolAlpha is similar to TokenBigram. The differences between them are the followings:

  • Blank handling

  • Symbol and alphabet handling

7.8.5.2. Syntax

TokenBigramIgnoreBlankSplitSymbolAlpha hasn’t parameter:

TokenBigramIgnoreBlankSplitSymbolAlpha

7.8.5.3. Usage

TokenBigramIgnoreBlankSplitSymbolAlpha ignores white-spaces in continuous symbols and non-ASCII characters.

TokenBigramIgnoreBlankSplitSymbolAlpha tokenizes symbols and alphabets by bigram tokenize method.

You can find difference of them by Hello ! ! ! text because it has symbols and non-ASCII characters with white spaces and alphabets.

Here is a result by TokenBigram :

Execution example:

tokenize TokenBigram "Hello 日 本 語 ! ! !" NormalizerAuto
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     {
#       "position": 0,
#       "force_prefix": false,
#       "value": "hello"
#     },
#     {
#       "position": 1,
#       "force_prefix": false,
#       "value": "日"
#     },
#     {
#       "position": 2,
#       "force_prefix": false,
#       "value": "本"
#     },
#     {
#       "position": 3,
#       "force_prefix": false,
#       "value": "語"
#     },
#     {
#       "position": 4,
#       "force_prefix": false,
#       "value": "!"
#     },
#     {
#       "position": 5,
#       "force_prefix": false,
#       "value": "!"
#     },
#     {
#       "position": 6,
#       "force_prefix": false,
#       "value": "!"
#     }
#   ]
# ]

Here is a result by TokenBigramIgnoreBlankSplitSymbolAlpha:

Execution example:

tokenize TokenBigramIgnoreBlankSplitSymbolAlpha "Hello 日 本 語 ! ! !" NormalizerAuto
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     {
#       "position": 0,
#       "force_prefix": false,
#       "value": "he"
#     },
#     {
#       "position": 1,
#       "force_prefix": false,
#       "value": "el"
#     },
#     {
#       "position": 2,
#       "force_prefix": false,
#       "value": "ll"
#     },
#     {
#       "position": 3,
#       "force_prefix": false,
#       "value": "lo"
#     },
#     {
#       "position": 4,
#       "force_prefix": false,
#       "value": "o日"
#     },
#     {
#       "position": 5,
#       "force_prefix": false,
#       "value": "日本"
#     },
#     {
#       "position": 6,
#       "force_prefix": false,
#       "value": "本語"
#     },
#     {
#       "position": 7,
#       "force_prefix": false,
#       "value": "語!"
#     },
#     {
#       "position": 8,
#       "force_prefix": false,
#       "value": "!!"
#     },
#     {
#       "position": 9,
#       "force_prefix": false,
#       "value": "!!"
#     },
#     {
#       "position": 10,
#       "force_prefix": false,
#       "value": "!"
#     }
#   ]
# ]