Skip to content

fix: handle whitespace-only documents - #16

Open
minisha23 wants to merge 1 commit into
github-community-gitam:mainfrom
minisha23:fix/whitespace-only-chunking
Open

minisha23 wants to merge 1 commit into
github-community-gitam:mainfrom
minisha23:fix/whitespace-only-chunking

Conversation

@minisha23

Copy link
Copy Markdown

Related Issue

Closes #4

Summary

Fixes the chunking behavior for documents containing only whitespace.

Whitespace-only documents are now treated as empty and return no chunks.

Changes

  • Updated chunking logic to ignore whitespace-only documents
  • Added a test for whitespace-only documents
  • Added a test for newline-only documents
  • Preserved existing chunking behavior for normal text

Tests

  • pytest tests/test_chunkers.py
  • 10 tests passed

Scope Check

Only the chunking logic and chunker tests were modified.

Secrets Check

No secrets or sensitive files were added.

@nitflame nitflame left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid

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.

Fix chunking for whitespace-only documents

2 participants