package eu.gaudian.translator.model.grammar

/**
 * Base class for all morphology rules.
 */
sealed class MorphologyRule {

    /**
     * RULE: Extract a 2D Grid (e.g., German Nouns).
     * @param rowTags The tags defining the rows (e.g., Nominative, Genitive).
     * @param colTags The tags defining the columns (e.g., Singular, Plural).
     * @param title Display title for the table.
     * @param fallbackStrategy Optional: If cell is missing, how to generate it (e.g., use Lemma).
     */
    data class GridRule(
        val title: String,
        val rowTags: List<String>,
        val colTags: List<String>,
        val fallbackStrategy: ((row: String, col: String, lemma: String) -> String?)? = null
    ) : MorphologyRule()

    /**
     * RULE: Extract a Verb Paradigm.
     * @param tenses Map of "Internal Tag" -> "Display Label".
     * @param pronouns List of pronouns to display.
     */
    data class VerbRule(
        val tenses: Map<String, String>,
        val pronouns: List<String>
    ) : MorphologyRule()

    /**
     * RULE: Just show everything generic.
     */
    object GenericRule : MorphologyRule()
}