Skip to main content

Module tag_normalizer

Module tag_normalizer 

Source
Expand description

Tag normalization with fuzzy matching.

When a user adds a tag, this module checks if a similar tag already exists in the task list and normalizes it automatically.

§Rules

  1. Exact match — tag already exists as-is → use it unchanged
  2. Case-insensitive matchRust matches rust → normalize to existing
  3. Fuzzy match — edit distance ≤ threshold → normalize to closest match
  4. No match — tag is new → accept as-is

§Threshold

  • Tags ≤ 4 chars: distance ≤ 1
  • Tags ≥ 5 chars: distance ≤ 2

This avoids false positives like rustjust (distance 2 on a 4-char tag).

Enums§

NormalizeResult
Result of normalizing a single tag.

Functions§

collect_existing_tags
Collect all unique tags from a task list.
normalize_tag
Normalize a single tag against the list of existing tags.
normalize_tags
Normalize a list of tags against existing tags.