| |
| """ |
| Quick test of the restored multi-input functionality |
| """ |
|
|
| from thematic_word_generator import UnifiedThematicWordGenerator |
|
|
| def test_multi_input(): |
| print("๐งช Testing Restored Multi-Input Functionality") |
| print("=" * 60) |
| |
| |
| generator = UnifiedThematicWordGenerator(vocab_size_limit=5000) |
| generator.initialize() |
| |
| print("\n๐ Test 1: Single word input") |
| results = generator.generate_thematic_words("cat", num_words=5) |
| for word, sim, tier in results: |
| print(f" {word:<12} (sim: {sim:.3f}, {tier})") |
| |
| print("\n๐ Test 2: Multiple word input") |
| results = generator.generate_thematic_words(["cat", "dog", "pet"], num_words=5) |
| for word, sim, tier in results: |
| print(f" {word:<12} (sim: {sim:.3f}, {tier})") |
| |
| print("\n๐ Test 3: Sentence input") |
| results = generator.generate_thematic_words(["I love furry animals that purr"], num_words=5) |
| for word, sim, tier in results: |
| print(f" {word:<12} (sim: {sim:.3f}, {tier})") |
| |
| print("\n๐ Test 4: Multi-theme detection") |
| results = generator.generate_thematic_words( |
| ["science", "technology", "research", "innovation"], |
| num_words=8, |
| multi_theme=True |
| ) |
| for word, sim, tier in results: |
| print(f" {word:<12} (sim: {sim:.3f}, {tier})") |
| |
| print("\nโ
All tests completed successfully!") |
|
|
| if __name__ == "__main__": |
| test_multi_input() |