Skip to content

Conversation

@nailo2c
Copy link
Owner

@nailo2c nailo2c commented Jul 25, 2025

The previous implementation of LCSMatch used a set-based check to quickly filter out non-matching sequences. However, this logic was flawed and would incorrectly reject matches when the input sequence contained many repeated tokens, as this would make len(set(seq)) artificially small.

This commit removes the faulty set-based check and relies solely on the more accurate LCS algorithm for matching. A new test case has been added to verify that the fix works as expected.

Fixes #1

The previous implementation of `LCSMatch` used a set-based check to quickly filter out non-matching sequences. However, this logic was flawed and would incorrectly reject matches when the input sequence contained many repeated tokens, as this would make `len(set(seq))` artificially small.

This commit removes the faulty set-based check and relies solely on the more accurate LCS algorithm for matching. A new test case has been added to verify that the fix works as expected.

Fixes #1
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.

逻辑不自洽

2 participants