feat: add support for parsing and indexing plain text (.txt) files - #483
Open
denis-samatov wants to merge 1 commit into
Open
feat: add support for parsing and indexing plain text (.txt) files#483denis-samatov wants to merge 1 commit into
denis-samatov wants to merge 1 commit into
Conversation
- Implement pageindex.page_index_txt with extract_nodes_from_txt and txt_to_tree - Support chapter/section headings, numbered headings, underlined headings, and paragraph blocks - Add --txt_path option to run_pageindex.py CLI - Add test_page_index_txt.py with comprehensive unit tests Closes VectifyAI#222
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.txt) documents into PageIndex hierarchical tree structures.--txt_pathinrun_pageindex.pyalongside--pdf_pathand--md_path.Changes
pageindex/page_index_txt.py:extract_nodes_from_txt: extracts document structure from plain text by identifying:Chapter 1: Intro,Section 2)1. Introduction,1.2 Details)===or---)txt_to_tree: generates standard PageIndex structure (title,node_id,line_num,text,nodes) with support for summaries, thinning, and document descriptions.pageindex/__init__.py:txt_to_treelazily in__all__and_LAZYdictionary so top-level imports remain lightweight without eager subpackage loading.run_pageindex.py:--txt_pathCLI argument.--pdf_path,--md_path, or--txt_path.--txt_pathprocessing and output saving toresults/<doc_name>_structure.json.tests/test_page_index_txt.py:txt_to_treeexecution.Verification
pytest tests/test_page_index_txt.py: 6 passed.pytest tests/test_package_surface.py: 11 passed (lazy import verification passed).Closes #222