package org.studiorailgun.ai.conversation.evaluators.query;

import org.studiorailgun.ai.conversation.tracking.Conversation;
import org.studiorailgun.ai.conversation.tracking.Quote;
import org.studiorailgun.ai.conversation.tracking.Sentence;
import org.studiorailgun.ai.knowledge.query.QualityQuery;

/**
 * Interrogatives available
 */
public class Interrogative {
    
    /**
     * Pronouns that are interrogative
     */
    public static enum InterrogativePronoun {
        WHAT,
        WHICH,
        WHO,
        WHOSE,
    }

    /**
     * Adverbs that are interrogative
     */
    public static enum InterrogativeAdverb {
        WHY,
        WHERE,
        HOW,
        WHEN,
    }

    /**
     * Evaluates a query of "which"
     * @param conversation The conversation
     * @param quote The quote
     * @param interrogative The interrogative noun
     * @param items The items noun
     * @return null
     */
    public static void evalWhichQuery(Conversation conversation, Quote quote, Sentence sentence, NounStack interrogative, NounStack items){
        if(QualityQuery.isQualityClarificationQuery(interrogative)){
            conversation.getGoalData().getQueryData().getRecentQueries().add(sentence);
        } else {
            throw new Error("Unknown query type!");
        }
    }

    /**
     * Evaluates a query of "what"
     * @param conversation The conversation
     * @param quote The quote
     * @param interrogative The interrogative noun
     * @param items The items noun
     * @return null
     */
    public static void evalWhatQuery(Conversation conversation, Quote quote, Sentence sentence, NounStack interrogative, NounStack items){
        if(QualityQuery.isQualityClarificationQuery(interrogative)){
            conversation.getGoalData().getQueryData().getRecentQueries().add(sentence);
        } else {
            throw new Error("Unknown query type!");
        }
    }

}
