Skip to content

test: document rule-extraction case, punctuation and Unicode behavior (#2) - #4

Open
Cid-oe wants to merge 1 commit into
Ricardo-M-L:mainfrom
Cid-oe:test/issue-2-rule-extraction-behavior
Open

test: document rule-extraction case, punctuation and Unicode behavior (#2)#4
Cid-oe wants to merge 1 commit into
Ricardo-M-L:mainfrom
Cid-oe:test/issue-2-rule-extraction-behavior

Conversation

@Cid-oe

@Cid-oe Cid-oe commented Sep 7, 2026

Copy link
Copy Markdown

Summary

Resolves #2.

Documents and asserts RuleExtractor's regression behavior across whitespace trimming, sentence-final punctuation, repeated punctuation, English case normalization, non-ASCII/Unicode letters, mixed CJK/Latin phrasing, and unsupported edge cases.

Changes

  • Regression Tests (src/extract.rs):
    • Added table-driven test rule_extractor_behavior_matrix asserting positive extractions for:
      • Leading and trailing whitespace handling.
      • Sentence-final punctuation (., !, ?).
      • Repeated punctuation (!!!???).
      • Full-width Chinese punctuation and lead word stripping ().
      • Mixed English case normalization (ALICE PREFERS VIM -> alice, prefers, vim).
      • Capitalized multi-word predicates (Bob Works At Microsoft.).
      • Non-ASCII German umlauts (Jürgen likes München) and accented characters (Renée lives in Paris).
      • CJK mixed with Latin names (Bob 住在 上海).
    • Added explicit negative test cases asserting empty extraction on:
      • Unsupported/unmodeled verbs.
      • Passive constructions (Rust is liked by Alice).
      • Self-referential statements (Alice likes Alice).
      • Trailing stop words reducing object to empty.
  • Documentation (docs/guide.md):
    • Added a Markdown table summarizing the supported and unsupported behavior matrix.
    • Clarified that rule extraction is intentionally limited pattern matching rather than general NER or semantic understanding.
  • Chinese README (README.zh-CN.md):
    • Linked directly to docs/guide.md#rule-extraction-behavior-matrix.

Validation

  • cargo test passes (61/61 library tests, all CLI & integration tests green).
  • cargo clippy --all-targets --all-features -- -D warnings passes with zero warnings.
  • git diff --check passes cleanly.

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.

test: document rule-extraction case, punctuation and Unicode behavior

1 participant