Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve text splitter to avoid cutting words in chunks #242

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

NathalieCharbel
Copy link

@NathalieCharbel NathalieCharbel commented Jan 9, 2025

Description

Add optional approximate splitting Flag to FixedSizeSplitte to ensure chunks start and end cleanly without words cut in the middle, honouring a desired chunk size and overlap. Also, “no whitespace found” fallbacks are considered during both chunk start and end adjustments, ensuring that if a large word has no whitespace, we revert to the original boundary to avoid unexpected behaviour.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Medium

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@NathalieCharbel NathalieCharbel requested a review from a team as a code owner January 9, 2025 09:25
@stellasia
Copy link
Contributor

LGTM, just a minor question in the tests.

Also, remember to add a line in the CHANGELOG (in a Changed subsection). And I think you need some ruff formatting for the workflows to pass.

@NathalieCharbel NathalieCharbel force-pushed the approximate-fixed-size-splitter branch from 27c5fd3 to 385492b Compare January 20, 2025 14:56
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