mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 19:27:11 +08:00
The uniqueness guard counted occurrences via normalize_for_fuzzy_match, while fuzzy_find_text located matches with a whitespace-flexible regex, so the two could disagree. Extract the pattern builder as a single source of truth (_build_fuzzy_pattern) and add count_matches, which counts with the same exact-then-fuzzy strategy used to locate and replace. This is the optional follow-up suggested in the review of #2942. Adds regression tests for exact and fuzzy multi-match rejection.
7.3 KiB
7.3 KiB