#!/usr/bin/env python3 import sys sys.path.insert(0, '/MASTERFOLDER/Tools/text-polish/src') from model_loader import load_model, polish from au_spelling import convert_to_au_spelling from src.config import AGGRESSION, CUSTOM_DICTIONARY, MIN_LENGTH # Test all features together print("Testing all features:") print("AGGRESSION:", AGGRESSION) print("CUSTOM_DICTIONARY:", CUSTOM_DICTIONARY) print("MIN_LENGTH:", MIN_LENGTH) # Test with different values test_cases = [ ("minimal", "custom"), ("moderate", "custom"), ("custom", "minimal") ] for aggression_level, dictionary_type in test_cases: print(f"Aggression: {aggression_level}, Dictionary: {dictionary_type}") # Test AU spelling conversion print("\nAU Spelling Conversion Tests:") test_text = "color theater organize" result = convert_to_au_spelling(test_text) print(f"Input: {test_text}") print(f"Output: {result}") # Test model inference print("\nModel Inference Tests:") model, tokenizer = load_model() test_input = "teh color was realy nice" result = polish(model, tokenizer, test_input) print(f"Input: {test_input}") print(f"Output: {result}")