@@ -40,6 +40,8 @@ def __init__(self):
4040 self .is_running = True
4141 self .processing_history = []
4242 self .enable_indexing = True # Default configuration
43+ self .segmentation_enabled = True # Default to smart segmentation
44+ self .segmentation_threshold = 50000 # Default threshold
4345
4446 # Check tkinter availability for file dialogs
4547 self .tkinter_available = True
@@ -125,6 +127,9 @@ def create_menu(self):
125127 # Display current configuration
126128 pipeline_mode = "🧠 COMPREHENSIVE" if self .enable_indexing else "⚡ OPTIMIZED"
127129 index_status = "✅ Enabled" if self .enable_indexing else "🔶 Disabled"
130+ segmentation_mode = (
131+ "📄 SMART" if self .segmentation_enabled else "📋 TRADITIONAL"
132+ )
128133
129134 menu = f"""
130135{ Colors .BOLD } { Colors .CYAN } ╔═══════════════════════════════════════════════════════════════════════════════╗
@@ -135,6 +140,7 @@ def create_menu(self):
135140║ ║
136141║ { Colors .BOLD } 🤖 Current Pipeline Mode: { pipeline_mode } { Colors .CYAN } ║
137142║ { Colors .BOLD } 🗂️ Codebase Indexing: { index_status } { Colors .CYAN } ║
143+ ║ { Colors .BOLD } 📄 Document Processing: { segmentation_mode } { Colors .CYAN } ║
138144║ ║
139145║ { Colors .YELLOW } 📝 URL Processing:{ Colors .CYAN } ║
140146║ { Colors .YELLOW } ▶ Enter research paper URL (arXiv, IEEE, ACM, etc.) { Colors .CYAN } ║
@@ -693,6 +699,11 @@ def show_history(self):
693699 def show_configuration_menu (self ):
694700 """Show configuration options menu"""
695701 self .clear_screen ()
702+
703+ # Get segmentation config status
704+ segmentation_enabled = getattr (self , "segmentation_enabled" , True )
705+ segmentation_threshold = getattr (self , "segmentation_threshold" , 50000 )
706+
696707 print (f"""
697708{ Colors .BOLD } { Colors .CYAN } ╔═══════════════════════════════════════════════════════════════════════════════╗
698709║ CONFIGURATION MENU ║
@@ -716,9 +727,23 @@ def show_configuration_menu(self):
716727║ ✗ Repository Acquisition (Skipped) ║
717728║ ✗ Codebase Intelligence Orchestration (Skipped) ║
718729║ ║
719- ║ { Colors .YELLOW } Current Setting:{ Colors .CYAN } { '🧠 Comprehensive Mode' if self .enable_indexing else '⚡ Optimized Mode' } ║
730+ ║ { Colors .OKCYAN } [2] Document Processing:{ Colors .CYAN } ║
731+ ║ { Colors .BOLD } 📄 Smart Segmentation{ Colors .CYAN } - Intelligent document analysis (Default) ║
732+ ║ ✓ Semantic boundary detection ║
733+ ║ ✓ Algorithm integrity preservation ║
734+ ║ ✓ Formula chain recognition ║
735+ ║ ✓ Adaptive character limits ║
736+ ║ ║
737+ ║ { Colors .BOLD } 📋 Traditional Processing{ Colors .CYAN } - Full document reading ║
738+ ║ ✓ Complete document analysis ║
739+ ║ ✗ Smart segmentation (Disabled) ║
720740║ ║
721- ║ { Colors .OKGREEN } [T] Toggle Pipeline Mode { Colors .CYAN } │ { Colors .FAIL } [B] Back to Main Menu{ Colors .CYAN } ║
741+ ║ { Colors .YELLOW } Current Settings:{ Colors .CYAN } ║
742+ ║ Pipeline: { '🧠 Comprehensive Mode' if self .enable_indexing else '⚡ Optimized Mode' } ║
743+ ║ Document: { '📄 Smart Segmentation' if segmentation_enabled else '📋 Traditional Processing' } ║
744+ ║ Threshold: { segmentation_threshold } characters ║
745+ ║ ║
746+ ║ { Colors .OKGREEN } [T] Toggle Pipeline { Colors .BLUE } [S] Toggle Segmentation { Colors .FAIL } [B] Back{ Colors .CYAN } ║
722747╚═══════════════════════════════════════════════════════════════════════════════╝{ Colors .ENDC }
723748""" )
724749
@@ -737,8 +762,25 @@ def show_configuration_menu(self):
737762 self .show_configuration_menu ()
738763 return
739764
765+ elif choice in ["s" , "segmentation" ]:
766+ current_state = getattr (self , "segmentation_enabled" , True )
767+ self .segmentation_enabled = not current_state
768+ seg_mode = (
769+ "📄 Smart Segmentation"
770+ if self .segmentation_enabled
771+ else "📋 Traditional Processing"
772+ )
773+ self .print_status (
774+ f"Document processing switched to: { seg_mode } " , "success"
775+ )
776+ time .sleep (1 )
777+ self .show_configuration_menu ()
778+ return
779+
740780 elif choice in ["b" , "back" ]:
741781 return
742782
743783 else :
744- self .print_status ("Invalid choice. Please enter 'T' or 'B'." , "warning" )
784+ self .print_status (
785+ "Invalid choice. Please enter 'T', 'S', or 'B'." , "warning"
786+ )
0 commit comments