View Source AhoCorasickNif.Native.BuilderOptions (aho_corasick_nif v0.1.0-beta.1)

Struct to represent the options passed to the builder.

The options are:

  • :aho_corasick_kind - the kind of Aho-Corasick algorithm to use
    • nil - use the default algorithm (it makes the chose based ont pattern counts)
    • :noncontiguous_nfa - use the noncontiguous NFA algorithm
    • :contiguous_nfa - use the contiguous NFA algorithm
    • :dfa - use the DFA algorithm
  • :ascii_case_insensitive - whether to ignore case for ASCII characters
  • :byte_classes - whether to use byte classes
  • :dense_depth - the depth at which to switch to the dense representation
    • nil - use the default depth (it uses defaults for each automata type)
    • non_neg_integer() - use the given depth
  • :match_kind - the kind of match to return
    • :standard - return all matches
    • :leftmost_longest - return the leftmost longest match
    • :leftmost_first - return the leftmost first match
  • :prefilter - whether to use the prefilter
  • :start_kind - the kind of start to use
    • :both - match both anchored and unanchored patterns
    • :unanchored - match only unanchored patterns
    • :anchored - match only anchored patterns

Summary

Functions

Validate the options passed to the builder.

Validate the options passed to the builder and raise an error if invalid.

Types

@type aho_corasick_kind() :: nil | :noncontiguous_nfa | :contiguous_nfa | :dfa
@type match_kind() :: :standard | :leftmost_longest | :leftmost_first
@type start_kind() :: :both | :unanchored | :anchored
@type t() :: %AhoCorasickNif.Native.BuilderOptions{
  aho_corasick_kind: nil | aho_corasick_kind(),
  ascii_case_insensitive: boolean(),
  byte_classes: boolean(),
  dense_depth: nil | non_neg_integer(),
  match_kind: match_kind(),
  prefilter: boolean(),
  start_kind: start_kind()
}

Functions

Validate the options passed to the builder.

Validate the options passed to the builder and raise an error if invalid.