Debian Codegraph @

doc/source/reference/commands/table_tokenize.rst

raw
1 .. -*- rst -*-
2
3 .. groonga-command
4 .. database: commands_table_tokenize
5
6 ``table_tokenize``
7 ==================
8
9 Summary
10 -------
11
12 ``table_tokenize`` command tokenizes text by the specified table's tokenizer.
13
14 Syntax
15 ------
16
17 This command takes many parameters.
18
19 ``table`` and ``string`` are required parameters. Others are
20 optional::
21
22 table_tokenize table
23 string
24 [flags=NONE]
25 [mode=GET]
26 [index_column=null]
27 [output_style=full]
28
29 Usage
30 -----
31
32 Here is a simple example.
33
34 .. groonga-command
35 .. include:: ../../example/reference/commands/table_tokenize/simple_example.log
36 .. plugin_register token_filters/stop_word
37 .. table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto --token_filters TokenFilterStopWord
38 .. column_create Terms is_stop_word COLUMN_SCALAR Bool
39 .. load --table Terms
40 .. [
41 .. {"_key": "and", "is_stop_word": true}
42 .. ]
43 .. table_tokenize Terms "Hello and Good-bye" --mode GET
44
45 ``Terms`` table is set ``TokenBigram`` tokenizer, ``NormalizerAuto`` normalizer,
46 ``TokenFilterStopWord`` token filter. It returns tokens that is
47 generated by tokenizing ``"Hello and Good-bye"`` with ``TokenBigram`` tokenizer.
48 It is normalized by ``NormalizerAuto`` normalizer.
49 ``and`` token is removed with ``TokenFilterStopWord`` token filter.
50
51 Parameters
52 ----------
53
54 This section describes all parameters. Parameters are categorized.
55
56 Required parameters
57 ^^^^^^^^^^^^^^^^^^^
58
59 There are required parameters, ``table`` and ``string``.
60
61 ``table``
62 """""""""
63
64 Specifies the lexicon table. ``table_tokenize`` command uses the
65 tokenizer, the normalizer, the token filters that is set the
66 lexicon table.
67
68 ``string``
69 """"""""""
70
71 Specifies any string which you want to tokenize.
72
73 See :ref:`tokenize-string` option in :doc:`/reference/commands/tokenize` about details.
74
75 Optional parameters
76 ^^^^^^^^^^^^^^^^^^^
77
78 There are optional parameters.
79
80 ``flags``
81 """""""""
82
83 Specifies a tokenization customize options. You can specify
84 multiple options separated by "``|``".
85
86 The default value is ``NONE``.
87
88 See :ref:`tokenize-flags` option in :doc:`/reference/commands/tokenize` about details.
89
90 ``mode``
91 """"""""
92
93 Specifies a tokenize mode.
94
95 The default value is ``GET``.
96
97 See :ref:`tokenize-mode` option in :doc:`/reference/commands/tokenize` about details.
98
99 ``index_column``
100 """"""""""""""""
101
102 Specifies an index column.
103
104 Return value includes ``estimated_size`` of the index.
105
106 The ``estimated_size`` is useful for checking estimated frequency of tokens.
107
108 ``output_style``
109 """"""""""""""""
110
111 .. versionadded:: 15.0.9
112
113 Specifies the output style of the ``table_tokenize`` command.
114
115 See :ref:`tokenize-output-style` option in :doc:`/reference/commands/tokenize` about details.
116
117 Return value
118 ------------
119
120 ``table_tokenize`` command returns tokenized tokens.
121
122 See :ref:`tokenize-return-value` option in :doc:`/reference/commands/tokenize` about details.
123
124 See also
125 --------
126
127 * :doc:`/reference/tokenizers`
128 * :doc:`/reference/commands/tokenize`