// Path: src/main/java/cz/brmlab/brmson/takepig/basephase/AbstractAnswerTypeExtractor.java
// public abstract class AbstractAnswerTypeExtractor extends AbstractLoggedComponent {
// 	protected JCas jcas;
// 
// 	public abstract String extractAnswerTypes(String question);
// 
// 	@Override
// 	public final void process(JCas jcas) throws AnalysisEngineProcessException {
// 		super.process(jcas);
// 		this.jcas = jcas;
// 		try {
// 			// prepare input
// 			InputElement input = ((InputElement) BaseJCasHelper.getAnnotation(
// 					jcas, InputElement.type));
// 			String questionText = input.getQuestion();
// 			log("QUESTION: " + questionText);
// 			
// 			// do task
// 			String answerType = extractAnswerTypes(questionText);
// 			log("TYPE_DETECTED: " + answerType);
// 
// 			// save output
// 			AnswerTypeJCasManipulator.storeAnswerType(
// 					ViewManager.getView(jcas, ViewType.ANS_TYPE), answerType);
// 
// 		} catch (Exception e) {
// 			throw new AnalysisEngineProcessException(e);
// 		}
// 	}
// 
// 	protected final void log(String message) {
// 		super.log(TPLogEntry.ANS_TYPE, message);
// 	}
// 
// }
// 
// Path: src/main/java/cz/brmlab/brmson/core/provider/wordnet/WordNetWrapper.java
// public final class WordNetWrapper extends WordNet {
// 	/* These data files can be download at http://pasky.or.cz/dev/brmson/res-wordnet.zip */
// 
// 	private static final String WORDNET_PATH = "res/ephyra/ontologies/wordnet/file_properties.xml";
// 
// 
// 	private static boolean initialized = false;
// 
// 	public static void initialize() throws Exception {
// 		if (initialized)
// 			return;
// 
// 		if (!initialize(WORDNET_PATH))
// 			throw new Exception("Could not initialize WordNet.");
// 
// 		initialized = true;
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import edu.cmu.lti.javelin.util.Language;
import edu.cmu.lti.util.Pair;
import info.ephyra.questionanalysis.atype.AnswerType;
import info.ephyra.questionanalysis.atype.QuestionClassifier;
import info.ephyra.questionanalysis.atype.QuestionClassifierFactory;
import org.apache.uima.UimaContext;
import org.apache.uima.resource.ResourceInitializationException;
import cz.brmlab.brmson.takepig.basephase.AbstractAnswerTypeExtractor;
import cz.brmlab.brmson.core.provider.wordnet.WordNetWrapper;
package cz.brmlab.brmson.blanqa.phase.answertype;






/**
 * Answer type extractor that "just" offloads this work to legacy Ephyra code.
 *
 * This actually means pretty heavy NLP lifting.
 */

public class EphyraAnswerTypeExtractor extends AbstractAnswerTypeExtractor {
	protected QuestionClassifier qc;

	@Override
	public void initialize(UimaContext aContext)
			throws ResourceInitializationException {
		super.initialize(aContext);

		try {
			// Ephyra is going to need this...
// Path: src/main/java/cz/brmlab/brmson/takepig/basephase/AbstractAnswerTypeExtractor.java
// public abstract class AbstractAnswerTypeExtractor extends AbstractLoggedComponent {
// 	protected JCas jcas;
// 
// 	public abstract String extractAnswerTypes(String question);
// 
// 	@Override
// 	public final void process(JCas jcas) throws AnalysisEngineProcessException {
// 		super.process(jcas);
// 		this.jcas = jcas;
// 		try {
// 			// prepare input
// 			InputElement input = ((InputElement) BaseJCasHelper.getAnnotation(
// 					jcas, InputElement.type));
// 			String questionText = input.getQuestion();
// 			log("QUESTION: " + questionText);
// 			
// 			// do task
// 			String answerType = extractAnswerTypes(questionText);
// 			log("TYPE_DETECTED: " + answerType);
// 
// 			// save output
// 			AnswerTypeJCasManipulator.storeAnswerType(
// 					ViewManager.getView(jcas, ViewType.ANS_TYPE), answerType);
// 
// 		} catch (Exception e) {
// 			throw new AnalysisEngineProcessException(e);
// 		}
// 	}
// 
// 	protected final void log(String message) {
// 		super.log(TPLogEntry.ANS_TYPE, message);
// 	}
// 
// }
// 
// Path: src/main/java/cz/brmlab/brmson/core/provider/wordnet/WordNetWrapper.java
// public final class WordNetWrapper extends WordNet {
// 	/* These data files can be download at http://pasky.or.cz/dev/brmson/res-wordnet.zip */
// 
// 	private static final String WORDNET_PATH = "res/ephyra/ontologies/wordnet/file_properties.xml";
// 
// 
// 	private static boolean initialized = false;
// 
// 	public static void initialize() throws Exception {
// 		if (initialized)
// 			return;
// 
// 		if (!initialize(WORDNET_PATH))
// 			throw new Exception("Could not initialize WordNet.");
// 
// 		initialized = true;
// 	}
// }


// Path: src/main/java/cz/brmlab/brmson/blanqa/phase/answertype/EphyraAnswerTypeExtractor.java
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import edu.cmu.lti.javelin.util.Language;
import edu.cmu.lti.util.Pair;
import info.ephyra.questionanalysis.atype.AnswerType;
import info.ephyra.questionanalysis.atype.QuestionClassifier;
import info.ephyra.questionanalysis.atype.QuestionClassifierFactory;
import org.apache.uima.UimaContext;
import org.apache.uima.resource.ResourceInitializationException;
import cz.brmlab.brmson.takepig.basephase.AbstractAnswerTypeExtractor;
import cz.brmlab.brmson.core.provider.wordnet.WordNetWrapper;

package cz.brmlab.brmson.blanqa.phase.answertype;






/**
 * Answer type extractor that "just" offloads this work to legacy Ephyra code.
 *
 * This actually means pretty heavy NLP lifting.
 */

public class EphyraAnswerTypeExtractor extends AbstractAnswerTypeExtractor {
	protected QuestionClassifier qc;

	@Override
	public void initialize(UimaContext aContext)
			throws ResourceInitializationException {
		super.initialize(aContext);

		try {
			// Ephyra is going to need this...
			WordNetWrapper.initialize();