#!/usr/bin/env python3 """ Verification script for the enhanced pronunciation assessment system """ def verify_enhanced_features(): """Verify that the enhanced features are properly implemented""" print("Verifying enhanced pronunciation assessment system...") # Import the enhanced classes try: from src.apis.controllers.speaking_controller import ( EnhancedPronunciationAssessor, SimplePronunciationAssessor ) print("✓ Enhanced classes imported successfully") except ImportError as e: print(f"✗ Failed to import enhanced classes: {e}") return False # Test EnhancedPronunciationAssessor initialization try: enhanced_assessor = EnhancedPronunciationAssessor() print("✓ EnhancedPronunciationAssessor initialized successfully") except Exception as e: print(f"✗ Failed to initialize EnhancedPronunciationAssessor: {e}") return False # Test SimplePronunciationAssessor (backward compatibility) try: simple_assessor = SimplePronunciationAssessor() print("✓ SimplePronunciationAssessor (backward compatibility) initialized successfully") except Exception as e: print(f"✗ Failed to initialize SimplePronunciationAssessor: {e}") return False # Test method availability expected_methods = [ 'assess_pronunciation', '_enhanced_phoneme_comparison', '_analyze_prosody', '_create_phoneme_pairs', '_create_phoneme_comparison_summary' ] for method in expected_methods: if hasattr(enhanced_assessor, method): print(f"✓ Method {method} available") else: print(f"✗ Method {method} missing") return False # Test G2P enhancements try: from src.apis.controllers.speaking_controller import SimpleG2P g2p = SimpleG2P() if hasattr(g2p, 'get_visualization_data'): print("✓ G2P visualization data method available") else: print("✗ G2P visualization data method missing") return False except Exception as e: print(f"✗ Failed to test G2P enhancements: {e}") return False print("\nAll verification tests passed! The enhanced pronunciation system is ready.") return True if __name__ == "__main__": verify_enhanced_features()