Drops.Inflector.Rules (drops_inflector v0.1.0)
View SourceA set of inflection rules that can be applied to words.
This module manages a list of rules (patterns and replacements) that are applied in order until one matches and transforms the input word.
Summary
Functions
Applies the rules to a word, returning the transformed word.
Iterates over all rules, calling the given function for each rule.
Inserts a rule at the specified index.
Creates a new empty Rules struct.
Types
Functions
Applies the rules to a word, returning the transformed word.
Rules are applied in order until one matches and transforms the word. If no rules match, the original word is returned.
Iterates over all rules, calling the given function for each rule.
@spec insert(t(), non_neg_integer(), rule()) :: t()
Inserts a rule at the specified index.
@spec new() :: t()
Creates a new empty Rules struct.