import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import com.softcorporation.sandi.base.service.SynonymService;
import com.softcorporation.sandi.base.util.SynonymException;

/**
 * Example demonstrating the stemming functionality in SynonymService
 */
public class StemmedSynonymExample {
    
    public static void main(String[] args) {
        // This is just an example - in a real application, SynonymService
        // would be initialized by Spring with proper configuration
        
        System.out.println("=== SANDI SynonymService Stemming Example ===");
        System.out.println();
        
        // Example of how to use the stemming functionality:
        System.out.println("The SynonymService now supports word stemming using Lucene analyzers.");
        System.out.println("This allows matching synonyms based on word stems, improving search flexibility.");
        System.out.println();
        
        System.out.println("Key Features:");
        System.out.println("1. Exact word matching (original functionality)");
        System.out.println("2. Stem-based matching (new functionality)");
        System.out.println("3. Configurable stemming (can be enabled/disabled)");
        System.out.println("4. Uses Lucene PorterStemFilter for English stemming");
        System.out.println();
        
        System.out.println("Usage Examples:");
        System.out.println("- getSynonyms(word, setName, false) // Exact matching");
        System.out.println("- getSynonyms(word, setName, true)  // With stemming"); 
        System.out.println("- getSynonymsByStem(word, setName)   // Direct stem matching");
        System.out.println();
        
        System.out.println("Stemming Examples:");
        System.out.println("- 'running' -> 'run' (stem)");
        System.out.println("- 'cars' -> 'car' (stem)");  
        System.out.println("- 'better' -> 'better' (stem)");
        System.out.println("- 'studies' -> 'studi' (stem)");
        System.out.println();
        
        System.out.println("Configuration:");
        System.out.println("- Property: sandi.synonyms.stemming.enabled=true/false");
        System.out.println("- Default: enabled");
    }
}