File size: 1,497 Bytes
486eff6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""
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)
    
    # Use small vocabulary for quick testing
    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()