View Source Haystack.Tokenizer.Token (Haystack v0.1.0)

A module for Tokens.

Link to this section Summary

Functions

Create a new token.

Link to this section Types

@type opts() :: [offset: integer(), length: integer()]
@type t() :: %Haystack.Tokenizer.Token{length: integer(), offset: integer(), v: v()}
@type v() :: String.t()

Link to this section Functions

@spec new(String.t(), opts()) :: t()

Create a new token.

examples

Examples

iex> Token.new("abc", offset: 0, length: 3)