Yasuhiro Horimoto 2018-12-27 14:12:14 +0900 (Thu, 27 Dec 2018) Revision: f5b576fdcfb02c4bb554dbfe6a4752f35dacb7d7 https://github.com/groonga/groonga/commit/f5b576fdcfb02c4bb554dbfe6a4752f35dacb7d7 Message: doc: Separate from tokenizers page Added files: doc/source/reference/tokenizers/token_delimit.rst Modified files: doc/locale/ja/LC_MESSAGES/reference.po Modified: doc/locale/ja/LC_MESSAGES/reference.po (+168 -144) =================================================================== --- doc/locale/ja/LC_MESSAGES/reference.po 2018-12-27 11:44:39 +0900 (3a6b91a5e) +++ doc/locale/ja/LC_MESSAGES/reference.po 2018-12-27 14:12:14 +0900 (b80868027) @@ -27239,150 +27239,6 @@ msgstr "" "トークンが3文字です。" msgid "" -"``TokenDelimit`` extracts token by splitting one or more space characters " -"(``U+0020``). For example, ``Hello World`` is tokenized to ``Hello`` and " -"``World``." -msgstr "" -"``TokenDelimit`` は1つ以上の空白文字( ``U+0020`` )で分割してトークンを抽出" -"します。たとえば、 ``Hello World`` は ``Hello`` と ``World`` にトークナイズさ" -"れます。" - -msgid "" -"``TokenDelimit`` is suitable for tag text. You can extract ``groonga`` and " -"``full-text-search`` and ``http`` as tags from ``groonga full-text-search " -"http``." -msgstr "" -"``TokenDelimit`` はタグテキストに適切です。 ``groonga full-text-search " -"http`` というテキストから ``groonga`` 、 ``full-text-search`` 、 ``http`` を" -"抽出します。" - -msgid "Here is an example of ``TokenDelimit``:" -msgstr "以下は ``TokenDelimit`` の例です。" - -msgid "" -"``TokenDelimit`` can also specify options. ``TokenDelimit`` has " -"``delimiter`` option and ``pattern`` option." -msgstr "" -"``TokenDelimit`` はオプションを指定することもできます。 ``TokenDelimit`` は " -"``delimiter`` オプションと ``pattern`` オプションを持っています。" - -msgid "``delimiter`` option can split token with a specified characters." -msgstr "``delimiter`` オプションは、指定した文字でトークンに分割できます。" - -msgid "" -"For example, ``Hello,World`` is tokenized to ``Hello`` and ``World`` with " -"``delimiter`` option as below." -msgstr "" -"例えば、以下のように ``Hello,World`` は、``Hello`` と ``World`` にトークナイ" -"ズされます。" - -msgid "``delimiter`` option can also specify multiple delimiters." -msgstr "``delimiter`` オプションは、複数の区切り文字を指定することもできます。" - -msgid "" -"For example, ``Hello, World`` is tokenized to ``Hello`` and ``World``. ``,`` " -"and `` `` are delimiters in below example." -msgstr "" -"例えば、以下のように ``Hello, World`` は、``Hello`` と ``World`` にトークナイ" -"ズされます。" - -msgid "" -"``pattern`` option can split token with a regular expression. You can except " -"needless space by ``pattern`` option." -msgstr "" -"``pattern`` オプションは、正規表現でトークンを分割できます。``pattern`` オプ" -"ションを使うことで、不要な空白を除去することができます。" - -msgid "" -"For example, ``This is a pen. This is an apple`` is tokenized to ``This is a " -"pen`` and ``This is an apple`` with ``pattern`` option as below." -msgstr "" -"例えば、以下のように ``pattern`` オプションによって、 ``This is a pen. This " -"is an apple`` は ``This is a pen`` と ``This is an apple`` にトークナイズされ" -"ます。" - -msgid "" -"Normally, when ``This is a pen. This is an apple.`` is splitted by ``.``, " -"needless spaces are included at the beginning of \"This is an apple.\"." -msgstr "" -"通常、 ``This is a pen. This is an apple.`` を ``.`` で分割する際は、\"This " -"is an apple.\"の文頭に不要な空白が含まれます。" - -msgid "" -"You can except the needless spaces by a ``pattern`` option as below example." -msgstr "" -"以下の例の用に ``pattern`` オプションを使うことで、その不要な空白を除去できま" -"す。" - -msgid "You can extract token in complex conditions by ``pattern`` option." -msgstr "``pattern`` オプションを使って複雑な条件でトークンを抽出できます。" - -msgid "" -"For example, ``これはペンですか!?リンゴですか?「リンゴです。」`` is " -"tokenize to ``これはペンですか`` and ``リンゴですか``, ``「リンゴです。」`` " -"with ``delimiter`` option as below." -msgstr "" -"例えば、以下のように ``delimiter`` オプションを使って、 ``これはペンです" -"か!?リンゴですか?「リンゴです。」`` を ``これはペンですか`` と ``リンゴで" -"すか`` 、 ``「リンゴです。」`` とトークナイズします。" - -msgid "" -"``\\\\s*`` of the end of above regular expression match 0 or more spaces " -"after a delimiter." -msgstr "" -"上記の正規表現の末尾の ``\\\\s*`` は、区切り文字の後ろの0個以上の空白にマッチ" -"します。" - -msgid "" -"``[。!?]+`` matches 1 or more ``。`` or ``!``, ``?``. For example, " -"``[。!?]+`` matches ``!?`` of ``これはペンですか!?``." -msgstr "" -"``[。!?]+`` は、1個以上の ``。`` または ``!``、 ``?`` にマッチします。例" -"えば、 ``[。!?]+`` は ``これはペンですか!?`` の ``!?`` にマッチします。" - -msgid "" -"``(?![)」])`` is negative lookahead. ``(?![)」])`` matches if a character " -"is not matched ``)`` or ``」``. negative lookahead interprets in " -"combination regular expression of just before." -msgstr "" -"``(?![)」])`` は否定先読みです。 ``(?![)」])`` は ``)`` または ``」`` に" -"マッチしない場合にマッチします。否定先読みは直前の正規表現と合わせて解釈しま" -"す。" - -msgid "Therefore it interprets ``[。!?]+(?![)」])``." -msgstr "したがって、 ``[。!?]+(?![)」])`` を解釈します。" - -msgid "" -"``[。!?]+(?![)」])`` matches if there are not ``)`` or ``」`` after ``。" -"`` or ``!``, ``?``." -msgstr "" -"``[。!?]+(?![)」])`` は、``。`` または ``!``、 ``?`` の後ろに ``)`` ま" -"たは ``」`` が無い場合にマッチします。" - -msgid "" -"In other words, ``[。!?]+(?![)」])`` matches ``。`` of ``これはペンです" -"か。``. But ``[。!?]+(?![)」])`` doesn't match ``。`` of ``「リンゴで" -"す。」``. Because there is ``」`` after ``。``." -msgstr "" -"つまり、 ``[。!?]+(?![)」])`` は、 ``これはペンですか。`` の ``。`` にマッ" -"チしますが、 ``「リンゴです。」`` の ``。`` にはマッチしません。 ``。`` の後" -"ろに ``」`` があるためです。" - -msgid "``[\\\\r\\\\n]+`` match 1 or more newline character." -msgstr "``[\\\\r\\\\n]+`` は、1個以上の改行文字にマッチします。" - -msgid "" -"In conclusion, ``([。!?]+(?![)」])|[\\\\r\\\\n]+)\\\\s*`` uses ``。`` and " -"``!`` and ``?``, newline character as delimiter. However, ``。`` and ``!" -"``, ``?`` are not delimiters if there is ``)`` or ``」`` after ``。`` or " -"``!``, ``?``." -msgstr "" -"まとめると、 ``([。!?]+(?![)」])|[\\\\r\\\\n]+)\\\\s*`` は、 ``。`` と " -"``!`` と ``?``、 改行文字を区切り文字としています。ただし、 ``。`` または " -"``!``、 ``?`` の後ろに ``)`` または ``」`` がある場合は、 ``。`` や ``!" -"``、 ``?`` は区切り文字としません。" - -msgid "" "``TokenDelimitNull`` is similar to :ref:`token-delimit`. The difference " "between them is separator character. :ref:`token-delimit` uses space " "character (``U+0020``) but ``TokenDelimitNull`` uses NUL character (``U" @@ -27532,6 +27388,174 @@ msgstr "" "入れ、テキストの最後にテキストの最後であるというマーク( ``U+FFF0`` )を入れ" "ます。" +msgid "" +"``TokenDelimit`` extracts token by splitting one or more space characters " +"(``U+0020``). For example, ``Hello World`` is tokenized to ``Hello`` and " +"``World``." +msgstr "" +"``TokenDelimit`` は1つ以上の空白文字( ``U+0020`` )で分割してトークンを抽出" +"します。たとえば、 ``Hello World`` は ``Hello`` と ``World`` にトークナイズさ" +"れます。" + +msgid "" +"``TokenDelimit`` is suitable for tag text. You can extract ``groonga`` and " +"``full-text-search`` and ``http`` as tags from ``groonga full-text-search " +"http``." +msgstr "" +"``TokenDelimit`` はタグテキストに適切です。 ``groonga full-text-search " +"http`` というテキストから ``groonga`` 、 ``full-text-search`` 、 ``http`` を" +"抽出します。" + +msgid "``TokenDelimit`` has optional parameter::" +msgstr "``TokenDelimit`` は、省略可能な引数があります。" + +msgid "Here is an example of ``TokenDelimit``:" +msgstr "以下は ``TokenDelimit`` の例です。" + +msgid "" +"``TokenDelimit`` can also specify options. ``TokenDelimit`` has " +"``delimiter`` option and ``pattern`` option." +msgstr "" +"``TokenDelimit`` はオプションを指定することもできます。 ``TokenDelimit`` は " +"``delimiter`` オプションと ``pattern`` オプションを持っています。" + +msgid "``delimiter`` option can split token with a specified character." +msgstr "``delimiter`` オプションは、指定した文字でトークンに分割できます。" + +msgid "" +"For example, ``Hello,World`` is tokenized to ``Hello`` and ``World`` with " +"``delimiter`` option as below." +msgstr "" +"例えば、以下のように ``Hello,World`` は、``Hello`` と ``World`` にトークナイ" +"ズされます。" + +msgid "" +"``pattern`` option can split token with a regular expression. You can except " +"needless space by ``pattern`` option." +msgstr "" +"``pattern`` オプションは、正規表現でトークンを分割できます。``pattern`` オプ" +"ションを使うことで、不要な空白を除去することができます。" + +msgid "" +"For example, ``This is a pen. This is an apple`` is tokenized to ``This is a " +"pen`` and ``This is an apple`` with ``pattern`` option as below." +msgstr "" +"例えば、以下のように ``pattern`` オプションによって、 ``This is a pen. This " +"is an apple`` は ``This is a pen`` と ``This is an apple`` にトークナイズされ" +"ます。" + +msgid "" +"Normally, when ``This is a pen. This is an apple.`` is splitted by ``.``, " +"needless spaces are included at the beginning of \"This is an apple.\"." +msgstr "" +"通常、 ``This is a pen. This is an apple.`` を ``.`` で分割する際は、\"This " +"is an apple.\"の文頭に不要な空白が含まれます。" + +msgid "" +"You can except the needless spaces by a ``pattern`` option as below example." +msgstr "" +"以下の例の用に ``pattern`` オプションを使うことで、その不要な空白を除去できま" +"す。" + +msgid "Advanced usage" +msgstr "高度な使い方" + +msgid "``delimiter`` option can also specify multiple delimiters." +msgstr "``delimiter`` オプションは、複数の区切り文字を指定することもできます。" + +msgid "" +"For example, ``Hello, World`` is tokenized to ``Hello`` and ``World``. ``,`` " +"and `` `` are delimiters in below example." +msgstr "" +"例えば、以下のように ``Hello, World`` は、``Hello`` と ``World`` にトークナイ" +"ズされます。" + +msgid "You can extract token in complex conditions by ``pattern`` option." +msgstr "``pattern`` オプションを使って複雑な条件でトークンを抽出できます。" + +msgid "" +"For example, ``これはペンですか!?リンゴですか?「リンゴです。」`` is " +"tokenize to ``これはペンですか`` and ``リンゴですか``, ``「リンゴです。」`` " +"with ``delimiter`` option as below." +msgstr "" +"例えば、以下のように ``delimiter`` オプションを使って、 ``これはペンです" +"か!?リンゴですか?「リンゴです。」`` を ``これはペンですか`` と ``リンゴで" +"すか`` 、 ``「リンゴです。」`` とトークナイズします。" + +msgid "" +"``\\\\s*`` of the end of above regular expression match 0 or more spaces " +"after a delimiter." +msgstr "" +"上記の正規表現の末尾の ``\\\\s*`` は、区切り文字の後ろの0個以上の空白にマッチ" +"します。" + +msgid "" +"``[。!?]+`` matches 1 or more ``。`` or ``!``, ``?``. For example, " +"``[。!?]+`` matches ``!?`` of ``これはペンですか!?``." +msgstr "" +"``[。!?]+`` は、1個以上の ``。`` または ``!``、 ``?`` にマッチします。例" +"えば、 ``[。!?]+`` は ``これはペンですか!?`` の ``!?`` にマッチします。" + +msgid "" +"``(?![)」])`` is negative lookahead. ``(?![)」])`` matches if a character " +"is not matched ``)`` or ``」``. negative lookahead interprets in " +"combination regular expression of just before." +msgstr "" +"``(?![)」])`` は否定先読みです。 ``(?![)」])`` は ``)`` または ``」`` に" +"マッチしない場合にマッチします。否定先読みは直前の正規表現と合わせて解釈しま" +"す。" + +msgid "Therefore it interprets ``[。!?]+(?![)」])``." +msgstr "したがって、 ``[。!?]+(?![)」])`` を解釈します。" + +msgid "" +"``[。!?]+(?![)」])`` matches if there are not ``)`` or ``」`` after ``。" +"`` or ``!``, ``?``." +msgstr "" +"``[。!?]+(?![)」])`` は、``。`` または ``!``、 ``?`` の後ろに ``)`` ま" +"たは ``」`` が無い場合にマッチします。" + +msgid "" +"In other words, ``[。!?]+(?![)」])`` matches ``。`` of ``これはペンです" +"か。``. But ``[。!?]+(?![)」])`` doesn't match ``。`` of ``「リンゴで" +"す。」``. Because there is ``」`` after ``。``." +msgstr "" +"つまり、 ``[。!?]+(?![)」])`` は、 ``これはペンですか。`` の ``。`` にマッ" +"チしますが、 ``「リンゴです。」`` の ``。`` にはマッチしません。 ``。`` の後" +"ろに ``」`` があるためです。" + +msgid "``[\\\\r\\\\n]+`` match 1 or more newline character." +msgstr "``[\\\\r\\\\n]+`` は、1個以上の改行文字にマッチします。" + +msgid "" +"In conclusion, ``([。!?]+(?![)」])|[\\\\r\\\\n]+)\\\\s*`` uses ``。`` and " +"``!`` and ``?``, newline character as delimiter. However, ``。`` and ``!" +"``, ``?`` are not delimiters if there is ``)`` or ``」`` after ``。`` or " +"``!``, ``?``." +msgstr "" +"まとめると、 ``([。!?]+(?![)」])|[\\\\r\\\\n]+)\\\\s*`` は、 ``。`` と " +"``!`` と ``?``、 改行文字を区切り文字としています。ただし、 ``。`` または " +"``!``、 ``?`` の後ろに ``)`` または ``」`` がある場合は、 ``。`` や ``!" +"``、 ``?`` は区切り文字としません。" + +msgid "There are two optional parameters ``delimiters`` and ``parameters``." +msgstr "省略可能引数は2つあります。 ``delimiters`` と ``parameters`` です。" + +msgid "``delimiters``" +msgstr "" + +msgid "Split token with a specified character." +msgstr "指定した文字でトークンを分割します。" + +msgid "``pattern``" +msgstr "" + +msgid "Split token with a regular expression." +msgstr "正規表現を使って、トークンを分割します。" + +msgid ":doc:`../commands/tokenize`" +msgstr "" + msgid "Tuning" msgstr "チューニング" Added: doc/source/reference/tokenizers/token_delimit.rst (+132 -0) 100644 =================================================================== --- /dev/null +++ doc/source/reference/tokenizers/token_delimit.rst 2018-12-27 14:12:14 +0900 (7b123787c) @@ -0,0 +1,132 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: tokenizers + +``TokenDelimit`` +================ + +Summary +------- + +``TokenDelimit`` extracts token by splitting one or more space +characters (``U+0020``). For example, ``Hello World`` is tokenized to +``Hello`` and ``World``. + +``TokenDelimit`` is suitable for tag text. You can extract ``groonga`` +and ``full-text-search`` and ``http`` as tags from ``groonga +full-text-search http``. + +Syntax +------ + +``TokenDelimit`` has optional parameter:: + + TokenDelimit[("delimiter", "delimiter_character1"], + ... + ["delimiter", "delimiter_characterN"], + ["pattern", "regular_expression1"])] + +Usage +----- + +Simple usage +------------ + +Here is an example of ``TokenDelimit``: + +.. groonga-command +.. include:: ../../example/reference/tokenizers/token-delimit.log +.. tokenize TokenDelimit "Groonga full-text-search HTTP" NormalizerAuto + +``TokenDelimit`` can also specify options. +``TokenDelimit`` has ``delimiter`` option and ``pattern`` option. + +``delimiter`` option can split token with a specified character. + +For example, ``Hello,World`` is tokenized to ``Hello`` and ``World`` +with ``delimiter`` option as below. + +.. groonga-command +.. include:: ../../example/reference/tokenizers/token-delimit-delimiter-option.log +.. tokenize 'TokenDelimit("delimiter", ",")' "Hello,World" + +``pattern`` option can split token with a regular expression. +You can except needless space by ``pattern`` option. + +For example, ``This is a pen. This is an apple`` is tokenized to ``This is a pen`` and +``This is an apple`` with ``pattern`` option as below. + +Normally, when ``This is a pen. This is an apple.`` is splitted by ``.``, +needless spaces are included at the beginning of "This is an apple.". + +You can except the needless spaces by a ``pattern`` option as below example. + +.. groonga-command +.. include:: ../../example/reference/tokenizers/token-delimit-pattern-option.log +.. tokenize 'TokenDelimit("pattern", "\\.\\s*")' "This is a pen. This is an apple." + +Advanced usage +-------------- + +``delimiter`` option can also specify multiple delimiters. + +For example, ``Hello, World`` is tokenized to ``Hello`` and ``World``. +``,`` and `` `` are delimiters in below example. + +.. groonga-command +.. include:: ../../example/reference/tokenizers/token-delimit-delimiter-option-multiple-delimiters.log +.. tokenize 'TokenDelimit("delimiter", ",", "delimiter", " ")' "Hello, World" + +You can extract token in complex conditions by ``pattern`` option. + +For example, ``これはペンですか!?リンゴですか?「リンゴです。」`` is tokenize to ``これはペンですか`` and ``リンゴですか``, ``「リンゴです。」`` with ``delimiter`` option as below. + +.. groonga-command +.. include:: ../../example/reference/tokenizers/token-delimit-pattern-option-with-complex-pattern.log +.. tokenize 'TokenDelimit("pattern", "([。!?]+(?![)」])|[\\r\\n]+)\\s*")' "これはペンですか!?リンゴですか?「リンゴです。」" + +``\\s*`` of the end of above regular expression match 0 or more spaces after a delimiter. + +``[。!?]+`` matches 1 or more ``。`` or ``!``, ``?``. +For example, ``[。!?]+`` matches ``!?`` of ``これはペンですか!?``. + +``(?![)」])`` is negative lookahead. +``(?![)」])`` matches if a character is not matched ``)`` or ``」``. +negative lookahead interprets in combination regular expression of just before. + +Therefore it interprets ``[。!?]+(?![)」])``. + +``[。!?]+(?![)」])`` matches if there are not ``)`` or ``」`` after ``。`` or ``!``, ``?``. + +In other words, ``[。!?]+(?![)」])`` matches ``。`` of ``これはペンですか。``. But ``[。!?]+(?![)」])`` doesn't match ``。`` of ``「リンゴです。」``. +Because there is ``」`` after ``。``. + +``[\\r\\n]+`` match 1 or more newline character. + +In conclusion, ``([。!?]+(?![)」])|[\\r\\n]+)\\s*`` uses ``。`` and ``!`` and ``?``, newline character as delimiter. However, ``。`` and ``!``, ``?`` are not delimiters if there is ``)`` or ``」`` after ``。`` or ``!``, ``?``. + +Parameters +---------- + +Optional parameter +^^^^^^^^^^^^^^^^^^ + +There are two optional parameters ``delimiters`` and ``parameters``. + +``delimiters`` +"""""""""""""" + +Split token with a specified character. + +``pattern`` +""""""""""" + +Split token with a regular expression. + +See also +---------- + +* :doc:`../commands/tokenize` -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181227/1263bca4/attachment-0001.html>