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

[Fix] Unify dataclasses under a types.py for ease #80

Merged
merged 3 commits into from
Dec 6, 2024
Merged

Conversation

bhavnicksm
Copy link
Collaborator

This pull request focuses on refactoring the Chonkie package by moving several dataclass definitions to a new types module and updating the imports across various files accordingly. The most important changes include the relocation of dataclasses, the update of imports, and the addition of new attributes to certain classes.

Refactoring and code organization:

  • src/chonkie/__init__.py: Moved Context, SemanticSentence, Sentence, Chunk, SentenceChunk, and SemanticChunk imports to the new types module.
  • src/chonkie/chunker/__init__.py: Updated imports to reflect the relocation of Chunk, SemanticChunk, SemanticSentence, and Sentence to the types module.
  • src/chonkie/chunker/base.py: Removed the Chunk dataclass and imported it from the types module instead.
  • src/chonkie/types.py: Added a new module to house the Context, Chunk, Sentence, SentenceChunk, SemanticSentence, and SemanticChunk dataclasses.

Class and method updates:

Test updates:

  • Updated test files to import Chunk and SemanticChunk from the new types module. [1] [2] [3]

@bhavnicksm bhavnicksm merged commit 98af028 into main Dec 6, 2024
1 check passed
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.

1 participant