Fuzler.Options (Fuzler v0.1.3)

Copy Markdown View Source

Options accepted by Fuzler scoring functions.

The defaults are:

  • normalization: :nfkc — Unicode compatibility normalisation;
  • strip_diacritics: false — preserve accents;
  • partial: true — search bounded windows in a longer target;
  • token_weight: 0.7 — token contribution for multi-token text;
  • partial_threshold: 0.6 — reject weak candidate windows;
  • max_bytes: 1_000_000 — per-input resource limit;
  • max_tokens: 50_000 — per-input normalised token limit;
  • max_batch_size: 10_000 — maximum targets per batch call;
  • max_total_bytes: 10_000_000 — combined query and batch target limit.

Use normalization: :nfc when compatibility folding is undesirable. Set strip_diacritics: true to make values such as "café" and "cafe" equivalent.

Summary

Types

Options controlling normalisation, scoring, and resource limits.

Types

option()

@type option() ::
  {:normalization, :nfc | :nfkc}
  | {:strip_diacritics, boolean()}
  | {:partial, boolean()}
  | {:token_weight, number()}
  | {:partial_threshold, number()}
  | {:max_bytes, pos_integer()}
  | {:max_tokens, pos_integer()}
  | {:max_batch_size, pos_integer()}
  | {:max_total_bytes, pos_integer()}

Options controlling normalisation, scoring, and resource limits.

validated()

@type validated() :: %{
  normalization: :nfc | :nfkc,
  strip_diacritics: boolean(),
  partial: boolean(),
  token_weight: float(),
  partial_threshold: float(),
  max_bytes: pos_integer(),
  max_tokens: pos_integer(),
  max_batch_size: pos_integer(),
  max_total_bytes: pos_integer()
}