Skip to content

feat(matcher_rs): add MatchTableBuilder for ergonomic MatchTable construction - #2

Merged
Lips7 merged 1 commit into
masterfrom
feature/match-table-builder
Feb 21, 2026
Merged

feat(matcher_rs): add MatchTableBuilder for ergonomic MatchTable construction#2
Lips7 merged 1 commit into
masterfrom
feature/match-table-builder

Conversation

@Lips7

@Lips7 Lips7 commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a fluent MatchTableBuilder that lets callers construct a MatchTable without building the struct literal directly, following the same pattern as the existing SimpleMatcherBuilder and MatcherBuilder.

Changes

  • builder.rs — New MatchTableBuilder<'a> with:
    • new(table_id, match_table_type) — required fields upfront
    • add_word / add_words — single and bulk word append
    • add_exemption_word / add_exemption_words — exemption variants
    • exemption_process_type(ProcessType) — override default (None)
    • build() -> MatchTable<'a> — consumes and returns the table
  • lib.rs — Re-exports MatchTableBuilder from the crate root
  • tests/test.rs — 6 new tests covering Simple, Regex, Similar types, bulk helpers, and exemption logic

Test Results

All 27 tests pass.

…truction

Add a fluent builder API for constructing MatchTable instances without
manually building the struct literal. The builder accepts the two
required fields (table_id, match_table_type) upfront and provides
chainable methods for the rest:

- add_word / add_words: single and bulk word append
- add_exemption_word / add_exemption_words: exemption variants
- exemption_process_type: override exemption ProcessType (defaults to None)
- build: consumes the builder and returns the MatchTable

Re-export MatchTableBuilder from the crate root.
Add 6 tests covering Simple, Regex, Similar match types, bulk helpers,
and exemption logic.
@Lips7
Lips7 merged commit 00b08b0 into master Feb 21, 2026
17 checks passed
@Lips7
Lips7 deleted the feature/match-table-builder branch February 21, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant