LoginSignup
13
11

More than 1 year has passed since last update.

ElasticsearchのTokenizerまとめ

Last updated at Posted at 2019-05-31

Standard Tokenizer

Standard Tokenizer は、(Unicode Standard Annex#29で指定されているように、Unicode Text Segmentationアルゴリズムに基づく)文法ベースのトークン化を提供し、ほとんどの言語でうまく機能します。

$ curl -X POST "localhost:9200/_analyze" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "standard",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
'
{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "2",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "<NUM>",
      "position" : 1
    },
    {
      "token" : "QUICK",
      "start_offset" : 6,
      "end_offset" : 11,
      "type" : "<ALPHANUM>",
      "position" : 2
    },
    {
      "token" : "Brown",
      "start_offset" : 12,
      "end_offset" : 17,
      "type" : "<ALPHANUM>",
      "position" : 3
    },
    {
      "token" : "Foxes",
      "start_offset" : 18,
      "end_offset" : 23,
      "type" : "<ALPHANUM>",
      "position" : 4
    },
    {
      "token" : "jumped",
      "start_offset" : 24,
      "end_offset" : 30,
      "type" : "<ALPHANUM>",
      "position" : 5
    },
    {
      "token" : "over",
      "start_offset" : 31,
      "end_offset" : 35,
      "type" : "<ALPHANUM>",
      "position" : 6
    },
    {
      "token" : "the",
      "start_offset" : 36,
      "end_offset" : 39,
      "type" : "<ALPHANUM>",
      "position" : 7
    },
    {
      "token" : "lazy",
      "start_offset" : 40,
      "end_offset" : 44,
      "type" : "<ALPHANUM>",
      "position" : 8
    },
    {
      "token" : "dog's",
      "start_offset" : 45,
      "end_offset" : 50,
      "type" : "<ALPHANUM>",
      "position" : 9
    },
    {
      "token" : "bone",
      "start_offset" : 51,
      "end_offset" : 55,
      "type" : "<ALPHANUM>",
      "position" : 10
    }
  ]
}

Letter Tokenizer

Letter Tokenizer は、文字ではない文字に遭遇したときはいつでもテキストを単語に分割します。
ほとんどのヨーロッパ言語では合理的な仕事をしますが、単語がスペースで区切られていない一部のアジア言語ではひどい仕事をします。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "letter",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
'

{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "QUICK",
      "start_offset" : 6,
      "end_offset" : 11,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "Brown",
      "start_offset" : 12,
      "end_offset" : 17,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "Foxes",
      "start_offset" : 18,
      "end_offset" : 23,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "jumped",
      "start_offset" : 24,
      "end_offset" : 30,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "over",
      "start_offset" : 31,
      "end_offset" : 35,
      "type" : "word",
      "position" : 5
    },
    {
      "token" : "the",
      "start_offset" : 36,
      "end_offset" : 39,
      "type" : "word",
      "position" : 6
    },
    {
      "token" : "lazy",
      "start_offset" : 40,
      "end_offset" : 44,
      "type" : "word",
      "position" : 7
    },
    {
      "token" : "dog",
      "start_offset" : 45,
      "end_offset" : 48,
      "type" : "word",
      "position" : 8
    },
    {
      "token" : "s",
      "start_offset" : 49,
      "end_offset" : 50,
      "type" : "word",
      "position" : 9
    },
    {
      "token" : "bone",
      "start_offset" : 51,
      "end_offset" : 55,
      "type" : "word",
      "position" : 10
    }
  ]
}

Lowercase Tokenizer

Lowercase Tokenizer は、Letter Tokenizer と同様に、文字ではない文字に遭遇するたびにテキストを単語に分割しますが、すべての用語を小文字にします。
これは機能的には Lowercase Token Filter と組み合わせた Letter Tokenizer と同等ですが、シングルパスで両方のステップを実行するためより効率的です。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "lowercase",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
'

{
  "tokens" : [
    {
      "token" : "the",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "quick",
      "start_offset" : 6,
      "end_offset" : 11,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "brown",
      "start_offset" : 12,
      "end_offset" : 17,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "foxes",
      "start_offset" : 18,
      "end_offset" : 23,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "jumped",
      "start_offset" : 24,
      "end_offset" : 30,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "over",
      "start_offset" : 31,
      "end_offset" : 35,
      "type" : "word",
      "position" : 5
    },
    {
      "token" : "the",
      "start_offset" : 36,
      "end_offset" : 39,
      "type" : "word",
      "position" : 6
    },
    {
      "token" : "lazy",
      "start_offset" : 40,
      "end_offset" : 44,
      "type" : "word",
      "position" : 7
    },
    {
      "token" : "dog",
      "start_offset" : 45,
      "end_offset" : 48,
      "type" : "word",
      "position" : 8
    },
    {
      "token" : "s",
      "start_offset" : 49,
      "end_offset" : 50,
      "type" : "word",
      "position" : 9
    },
    {
      "token" : "bone",
      "start_offset" : 51,
      "end_offset" : 55,
      "type" : "word",
      "position" : 10
    }
  ]
}

Whitespace Tokenizer

Whitespace Tokenizer は、空白文字に遭遇するたびにテキストを単語に分割します。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "whitespace",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
'

{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "2",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "QUICK",
      "start_offset" : 6,
      "end_offset" : 11,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "Brown-Foxes",
      "start_offset" : 12,
      "end_offset" : 23,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "jumped",
      "start_offset" : 24,
      "end_offset" : 30,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "over",
      "start_offset" : 31,
      "end_offset" : 35,
      "type" : "word",
      "position" : 5
    },
    {
      "token" : "the",
      "start_offset" : 36,
      "end_offset" : 39,
      "type" : "word",
      "position" : 6
    },
    {
      "token" : "lazy",
      "start_offset" : 40,
      "end_offset" : 44,
      "type" : "word",
      "position" : 7
    },
    {
      "token" : "dog's",
      "start_offset" : 45,
      "end_offset" : 50,
      "type" : "word",
      "position" : 8
    },
    {
      "token" : "bone.",
      "start_offset" : 51,
      "end_offset" : 56,
      "type" : "word",
      "position" : 9
    }
  ]
}

UAX URL Email Tokenizer

UAX URL Email Tokenizer は標準のトークナイザと似ていますが、URLと電子メールアドレスを単一のトークンとして認識する点が異なります。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "uax_url_email",
  "text": "Email me at john.smith@global-international.com"
}
'

{
  "tokens" : [
    {
      "token" : "Email",
      "start_offset" : 0,
      "end_offset" : 5,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "me",
      "start_offset" : 6,
      "end_offset" : 8,
      "type" : "<ALPHANUM>",
      "position" : 1
    },
    {
      "token" : "at",
      "start_offset" : 9,
      "end_offset" : 11,
      "type" : "<ALPHANUM>",
      "position" : 2
    },
    {
      "token" : "john.smith@global-international.com",
      "start_offset" : 12,
      "end_offset" : 47,
      "type" : "<EMAIL>",
      "position" : 3
    }
  ]
}

Classic Tokenizer

Classic Tokenizer は、英語の文書に適している文法ベースのトークナイザです。
このトークナイザは、頭字語、会社名、電子メールアドレス、およびインターネットホスト名の特別な扱いに関する発見的方法を持っています。
ただし、これらの規則は必ずしも有効ではなく、トークナイザーは英語以外のほとんどの言語ではうまく機能しません。

curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "classic",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
'

{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "<ALPHANUM>",
      "position" : 0
    },
    {
      "token" : "2",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "<ALPHANUM>",
      "position" : 1
    },
    {
      "token" : "QUICK",
      "start_offset" : 6,
      "end_offset" : 11,
      "type" : "<ALPHANUM>",
      "position" : 2
    },
    {
      "token" : "Brown",
      "start_offset" : 12,
      "end_offset" : 17,
      "type" : "<ALPHANUM>",
      "position" : 3
    },
    {
      "token" : "Foxes",
      "start_offset" : 18,
      "end_offset" : 23,
      "type" : "<ALPHANUM>",
      "position" : 4
    },
    {
      "token" : "jumped",
      "start_offset" : 24,
      "end_offset" : 30,
      "type" : "<ALPHANUM>",
      "position" : 5
    },
    {
      "token" : "over",
      "start_offset" : 31,
      "end_offset" : 35,
      "type" : "<ALPHANUM>",
      "position" : 6
    },
    {
      "token" : "the",
      "start_offset" : 36,
      "end_offset" : 39,
      "type" : "<ALPHANUM>",
      "position" : 7
    },
    {
      "token" : "lazy",
      "start_offset" : 40,
      "end_offset" : 44,
      "type" : "<ALPHANUM>",
      "position" : 8
    },
    {
      "token" : "dog's",
      "start_offset" : 45,
      "end_offset" : 50,
      "type" : "<APOSTROPHE>",
      "position" : 9
    },
    {
      "token" : "bone",
      "start_offset" : 51,
      "end_offset" : 55,
      "type" : "<ALPHANUM>",
      "position" : 10
    }
  ]
}

Thai Tokenizer

Thai Tokenizer は、Javaに含まれているタイ語のセグメンテーション・アルゴリズムを使用して、タイ語のテキストを単語に分割します。
他の言語のテキストは一般に Standard Tokenizer と同じように扱われます。

curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "thai",
  "text": "การท<0e35><0e48>ได<0e49>ต<0e49>องแสดงว<0e48>างานด<0e35>"
}
'

{
  "tokens" : [
    {
      "token" : "การ",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "ที่",
      "start_offset" : 3,
      "end_offset" : 6,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "ได้",
      "start_offset" : 6,
      "end_offset" : 9,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "ต้อง",
      "start_offset" : 9,
      "end_offset" : 13,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "แสดง",
      "start_offset" : 13,
      "end_offset" : 17,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "ว่า",
      "start_offset" : 17,
      "end_offset" : 20,
      "type" : "word",
      "position" : 5
    },
    {
      "token" : "งาน",
      "start_offset" : 20,
      "end_offset" : 23,
      "type" : "word",
      "position" : 6
    },
    {
      "token" : "ดี",
      "start_offset" : 23,
      "end_offset" : 25,
      "type" : "word",
      "position" : 7
    }
  ]
}

NGram Tokenizer

NGram Tokenizer は、最初に指定された文字のリストの1つに遭遇すると必ずテキストを単語に分割し、次に指定された長さの各単語をNグラムずつ出力します。
スペースを使用しない言語、またはドイツ語のように長い複合語を含む言語を照会するのに役立ちます。

curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "ngram",
  "text": "Quick Fox"
}
'

{
  "tokens" : [
    {
      "token" : "Q",
      "start_offset" : 0,
      "end_offset" : 1,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "Qu",
      "start_offset" : 0,
      "end_offset" : 2,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "u",
      "start_offset" : 1,
      "end_offset" : 2,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "ui",
      "start_offset" : 1,
      "end_offset" : 3,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "i",
      "start_offset" : 2,
      "end_offset" : 3,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "ic",
      "start_offset" : 2,
      "end_offset" : 4,
      "type" : "word",
      "position" : 5
    },
    {
      "token" : "c",
      "start_offset" : 3,
      "end_offset" : 4,
      "type" : "word",
      "position" : 6
    },
    {
      "token" : "ck",
      "start_offset" : 3,
      "end_offset" : 5,
      "type" : "word",
      "position" : 7
    },
    {
      "token" : "k",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "word",
      "position" : 8
    },
    {
      "token" : "k ",
      "start_offset" : 4,
      "end_offset" : 6,
      "type" : "word",
      "position" : 9
    },
    {
      "token" : " ",
      "start_offset" : 5,
      "end_offset" : 6,
      "type" : "word",
      "position" : 10
    },
    {
      "token" : " F",
      "start_offset" : 5,
      "end_offset" : 7,
      "type" : "word",
      "position" : 11
    },
    {
      "token" : "F",
      "start_offset" : 6,
      "end_offset" : 7,
      "type" : "word",
      "position" : 12
    },
    {
      "token" : "Fo",
      "start_offset" : 6,
      "end_offset" : 8,
      "type" : "word",
      "position" : 13
    },
    {
      "token" : "o",
      "start_offset" : 7,
      "end_offset" : 8,
      "type" : "word",
      "position" : 14
    },
    {
      "token" : "ox",
      "start_offset" : 7,
      "end_offset" : 9,
      "type" : "word",
      "position" : 15
    },
    {
      "token" : "x",
      "start_offset" : 8,
      "end_offset" : 9,
      "type" : "word",
      "position" : 16
    }
  ]
}

Edge NGram Tokenier

Edge NGram Tokenier は、指定された文字のリストの1つに遭遇するたびに、まずテキストを単語に分割し、次にNグラムの始まりが単語の始まりに固定されている各単語のNグラムを出力します。
Edge N-Gramsは、search-as-you-type 検索(サジェスト?)に役立ちます。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "edge_ngram",
  "text": "Quick Fox"
}
'

{
  "tokens" : [
    {
      "token" : "Q",
      "start_offset" : 0,
      "end_offset" : 1,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "Qu",
      "start_offset" : 0,
      "end_offset" : 2,
      "type" : "word",
      "position" : 1
    }
  ]
}

Keyword Tokenizer

Keyword Tokenizer は、与えられたどんなテキストでも受け入れて、まったく同じテキストを単一の用語として出力する「noop」トークナイザです。
トークンフィルタと組み合わせて、出力を正規化することができます。例えば小文字のEメールアドレス。

 curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "keyword",
  "text": "New York"
}
'

{
  "tokens" : [
    {
      "token" : "New York",
      "start_offset" : 0,
      "end_offset" : 8,
      "type" : "word",
      "position" : 0
    }
  ]
}

Pattern Tokennizer

Pattern Tokennizer は、正規表現を使用して、単語の区切り文字に一致するときは常にテキストを用語に分割するか、一致するテキストを用語としてキャプチャします。
デフォルトのパターンは\ W +で、単語以外の文字に遭遇するたびにテキストを分割します。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "pattern",
  "text": "The foo_bar_size\u0027s default is 5."
}
'

{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "foo_bar_size",
      "start_offset" : 4,
      "end_offset" : 16,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "s",
      "start_offset" : 17,
      "end_offset" : 18,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "default",
      "start_offset" : 19,
      "end_offset" : 26,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "is",
      "start_offset" : 27,
      "end_offset" : 29,
      "type" : "word",
      "position" : 4
    },
    {
      "token" : "5",
      "start_offset" : 30,
      "end_offset" : 31,
      "type" : "word",
      "position" : 5
    }
  ]
}

Char Group Tokenizer

Char Group Tokenizer は、定義された集合内にある文字に遭遇するたびにテキストを単語に分割します。
単純なカスタムトークン化が必要で、パターントークナイザの使用によるオーバーヘッドが許容されない場合に、これは主に役立ちます。

 curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": {
    "type": "char_group",
    "tokenize_on_chars": [
      "whitespace",
      "-",
      "\n"
    ]
  },
  "text": "The QUICK brown-fox"
}
'

{
  "tokens" : [
    {
      "token" : "The",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "QUICK",
      "start_offset" : 4,
      "end_offset" : 9,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "brown",
      "start_offset" : 10,
      "end_offset" : 15,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "fox",
      "start_offset" : 16,
      "end_offset" : 19,
      "type" : "word",
      "position" : 3
    }
  ]
}

Simple Pattern Tokenizer

Simple Pattern Tokenizer は、正規表現を使用して、一致するテキストを用語としてキャプチャします。
サポートしている正規表現機能のセットは Pattern Tokenizer よりも制限がありますが、トークン化は一般的に高速です。
このトークナイザは、Pattern Tokenizer とは異なり、パターンマッチでの入力の分割をサポートしません。
このトークナイザはLuceneの正規表現を使用します。サポートされている機能と構文の説明については、正規表現の構文を参照してください。
デフォルトのパターンは空の文字列で、これは用語を生成しません。このトークナイザは常にデフォルト以外のパターンで設定されるべきです。

$ curl -X PUT "localhost:9200/simple_pattern_index?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "my_tokenizer"
        }
      },
      "tokenizer": {
        "my_tokenizer": {
          "type": "simple_pattern",
          "pattern": "[0123456789]{3}"
        }
      }
    }
  }
}
'

{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "simple_pattern_index"
}
$ curl -X POST "localhost:9200/simple_pattern_index/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "analyzer": "my_analyzer",
  "text": "fd-786-335-514-x"
}
'

{
  "tokens" : [
    {
      "token" : "786",
      "start_offset" : 3,
      "end_offset" : 6,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "335",
      "start_offset" : 7,
      "end_offset" : 10,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "514",
      "start_offset" : 11,
      "end_offset" : 14,
      "type" : "word",
      "position" : 2
    }
  ]
}

Simple Pattern Split Tokenizer

Simple Pattern Split Tokenizer は、正規表現を使ってパターンマッチで入力を単語に分割します。
サポートしている正規表現機能のセットは Pattern Tokennizer よりも制限がありますが、トークン化は一般的に高速です。
このトークナイザは、マッチ自体から用語を生成しません。
同じ制限付き正規表現サブセット内のパターンを使用して一致から用語を生成するには、Simple Pattern Tokenizer を参照してください。
このトークナイザはLuceneの正規表現を使用します。サポートされている機能と構文の説明については、正規表現の構文を参照してください。
デフォルトのパターンは空の文字列で、これは完全な入力を含む1つの用語を生成します。このトークナイザは常にデフォルト以外のパターンで設定されるべきです。

$ curl -X PUT "localhost:9200/simple_pattern_split_index?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "my_tokenizer"
        }
      },
      "tokenizer": {
        "my_tokenizer": {
          "type": "simple_pattern_split",
          "pattern": "_"
        }
      }
    }
  }
}
'
{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "simple_pattern_split_index"
}
$ curl -X POST "localhost:9200/simple_pattern_split_index/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "analyzer": "my_analyzer",
  "text": "an_underscored_phrase"
}
'
{
  "tokens" : [
    {
      "token" : "an",
      "start_offset" : 0,
      "end_offset" : 2,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "underscored",
      "start_offset" : 3,
      "end_offset" : 14,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "phrase",
      "start_offset" : 15,
      "end_offset" : 21,
      "type" : "word",
      "position" : 2
    }
  ]
}

Path Hierarchy Tokenizer

Path Hierarchy Tokenizer は、ファイルシステムパスのような階層値を取り、パスの区切り文字で分割し、ツリー内の各コンポーネントの用語を発行します。

$ curl -X POST "localhost:9200/_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "tokenizer": "path_hierarchy",
  "text": "/one/two/three"
}
'

{
  "tokens" : [
    {
      "token" : "/one",
      "start_offset" : 0,
      "end_offset" : 4,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "/one/two",
      "start_offset" : 0,
      "end_offset" : 8,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "/one/two/three",
      "start_offset" : 0,
      "end_offset" : 14,
      "type" : "word",
      "position" : 0
    }
  ]
}

参考

13
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
11