@@ -40,6 +40,8 @@ def __init__(self):
40
40
self .is_running = True
41
41
self .processing_history = []
42
42
self .enable_indexing = True # Default configuration
43
+ self .segmentation_enabled = True # Default to smart segmentation
44
+ self .segmentation_threshold = 50000 # Default threshold
43
45
44
46
# Check tkinter availability for file dialogs
45
47
self .tkinter_available = True
@@ -125,6 +127,9 @@ def create_menu(self):
125
127
# Display current configuration
126
128
pipeline_mode = "🧠 COMPREHENSIVE" if self .enable_indexing else "⚡ OPTIMIZED"
127
129
index_status = "✅ Enabled" if self .enable_indexing else "🔶 Disabled"
130
+ segmentation_mode = (
131
+ "📄 SMART" if self .segmentation_enabled else "📋 TRADITIONAL"
132
+ )
128
133
129
134
menu = f"""
130
135
{ Colors .BOLD } { Colors .CYAN } ╔═══════════════════════════════════════════════════════════════════════════════╗
@@ -135,6 +140,7 @@ def create_menu(self):
135
140
║ ║
136
141
║ { Colors .BOLD } 🤖 Current Pipeline Mode: { pipeline_mode } { Colors .CYAN } ║
137
142
║ { Colors .BOLD } 🗂️ Codebase Indexing: { index_status } { Colors .CYAN } ║
143
+ ║ { Colors .BOLD } 📄 Document Processing: { segmentation_mode } { Colors .CYAN } ║
138
144
║ ║
139
145
║ { Colors .YELLOW } 📝 URL Processing:{ Colors .CYAN } ║
140
146
║ { Colors .YELLOW } ▶ Enter research paper URL (arXiv, IEEE, ACM, etc.) { Colors .CYAN } ║
@@ -693,6 +699,11 @@ def show_history(self):
693
699
def show_configuration_menu (self ):
694
700
"""Show configuration options menu"""
695
701
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
+
696
707
print (f"""
697
708
{ Colors .BOLD } { Colors .CYAN } ╔═══════════════════════════════════════════════════════════════════════════════╗
698
709
║ CONFIGURATION MENU ║
@@ -716,9 +727,23 @@ def show_configuration_menu(self):
716
727
║ ✗ Repository Acquisition (Skipped) ║
717
728
║ ✗ Codebase Intelligence Orchestration (Skipped) ║
718
729
║ ║
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) ║
720
740
║ ║
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 } ║
722
747
╚═══════════════════════════════════════════════════════════════════════════════╝{ Colors .ENDC }
723
748
""" )
724
749
@@ -737,8 +762,25 @@ def show_configuration_menu(self):
737
762
self .show_configuration_menu ()
738
763
return
739
764
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
+
740
780
elif choice in ["b" , "back" ]:
741
781
return
742
782
743
783
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