package org.studiorailgun.ai.linguistics;

import org.studiorailgun.ai.conversation.tracking.Conversation;
import org.studiorailgun.ai.conversation.tracking.Quote;
import org.studiorailgun.ai.conversation.web.QuoteQuery;
import org.studiorailgun.ai.knowledge.Node;

/**
 * Queries related to pronouns
 */
public class PronounQuery {

    /**
     * Tries to locate a pronoun
     * @param conversation The conversation
     * @param quote The quote
     * @param pronounText The pronoun text itself
     * @return The node representing the pronoun
     */
    public static Node getPronoun(Conversation conversation, Quote quote, String pronounText){
        Node rVal = null;
        switch(pronounText){
            case "I": {
                rVal = QuoteQuery.getSpeaker(quote.getNode());
            } break;
            default: {
                throw new Error("Unhandled pronoun type " + pronounText);
            }
        }
        return rVal;
    }
    
}
