Skip to content

fix: make exact-match whitespace collapsing opt-out - #11

Closed
slegarraga wants to merge 1 commit into
AgentPostmortem:mainfrom
slegarraga:fix/exact-match-collapse-whitespace
Closed

fix: make exact-match whitespace collapsing opt-out#11
slegarraga wants to merge 1 commit into
AgentPostmortem:mainfrom
slegarraga:fix/exact-match-collapse-whitespace

Conversation

@slegarraga

Copy link
Copy Markdown

Closes #9.

Adds a collapseWhitespace option to normalize() and threads it through exactMatchScorer.

  • collapseWhitespace defaults to true, preserving current behavior
  • setting it to false (with caseSensitive: true and trim: false) enables a byte-exact comparison
  • README and scorer docs now list the option
  • regression tests cover internal whitespace collapsing on and off

Verified with npm run typecheck and npm test (69 passed).

@royalpinto007

Copy link
Copy Markdown
Collaborator

Closing this PR.

The author is no longer an active contributor on these repositories, so this cannot be carried through review or iterated on.

The underlying issue stays open and is available for anyone who wants it. If you were looking at this change, please do open a fresh PR, it is very welcome.

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.

exact-match always collapses internal whitespace, and trim: false does not turn it off

2 participants