// Path: freya/freya-annotate/src/main/java/org/freya/model/Question.java
// @XmlRootElement
// public class Question {
// 
//     /**
//      * question type such as boolean, number, classic (all the others);
//      */
// 
//     public String sentenceText;
//     public Type type;
// 
//     public Type getType() {
//         return type;
//     }
// 
//     public void setType(Type type) {
//         this.type = type;
//     }
// 
//     List<HasWord> tokens;
// 
//     Tree syntaxTree;
// 
//     /* this is focus */
//     POC focus;
// 
//     List<OntologyElement> answerType;
// 
//     List<POC> pocs = new ArrayList<POC>();
// 
// 
//     public List<HasWord> getTokens() {
//         return tokens;
//     }
// 
//     public void setTokens(List<HasWord> tokens) {
//         this.tokens = tokens;
//     }
// 
// 
//     List<List<SemanticConcept>> semanticConcepts =
//                     new ArrayList<List<SemanticConcept>>();
// 
//     public List<OntologyElement> getAnswerType() {
//         return answerType;
//     }
// 
//     public void setAnswerType(List<OntologyElement> answerType) {
//         this.answerType = answerType;
//     }
// 
//     public POC getFocus() {
//         return focus;
//     }
// 
//     public void setFocus(POC focus) {
//         this.focus = focus;
//     }
// 
//     public Tree getSyntaxTree() {
//         return syntaxTree;
//     }
// 
//     public void setSyntaxTree(Tree syntaxTree) {
//         this.syntaxTree = syntaxTree;
//     }
// 
//     public List<List<SemanticConcept>> getSemanticConcepts() {
//         return semanticConcepts;
//     }
// 
//     public void setSemanticConcepts(List<List<SemanticConcept>> semanticConcepts) {
//         this.semanticConcepts = semanticConcepts;
//     }
// 
//     public List<POC> getPocs() {
//         return pocs;
//     }
// 
//     public void setPocs(List<POC> pocs) {
//         this.pocs = pocs;
//     }
// 
//     public String toString() {
//         StringBuffer b = new StringBuffer("");
//         b.append("sem concepts:");
//         if (this.semanticConcepts != null)
//             b.append(this.semanticConcepts.toString());
//         b.append("pocs:");
//         if (this.pocs != null) b.append(pocs.toString());
//         b.append("Tree:");
//         if (this.syntaxTree != null) b.append(this.syntaxTree.toString());
//         return b.toString();
//     }
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.freya.model.Question;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
package org.freya.mapping;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:META-INF/spring/freya-applicationContext.xml"})
@Configurable
public class FocusDemo {
    
    private static final Log logger = LogFactory.getLog(FocusDemo.class);
    
    @Autowired Mapper mapper;

   // @Test
    public void testMapper() throws Exception {

    	File inFile = new File("src/test/resources/FactualQuestions.txt");
    	File outFile = new File("src/test/resources/FactualQuestions-Focus.csv");
    	//load all questions
    	 PrintStream writer = null;
    	 writer = new PrintStream(outFile);
    	try (BufferedReader br = new BufferedReader(new FileReader(inFile))) {
    	    String line;
    	    while ((line = br.readLine()) != null) {
    	       // process the line.
// Path: freya/freya-annotate/src/main/java/org/freya/model/Question.java
// @XmlRootElement
// public class Question {
// 
//     /**
//      * question type such as boolean, number, classic (all the others);
//      */
// 
//     public String sentenceText;
//     public Type type;
// 
//     public Type getType() {
//         return type;
//     }
// 
//     public void setType(Type type) {
//         this.type = type;
//     }
// 
//     List<HasWord> tokens;
// 
//     Tree syntaxTree;
// 
//     /* this is focus */
//     POC focus;
// 
//     List<OntologyElement> answerType;
// 
//     List<POC> pocs = new ArrayList<POC>();
// 
// 
//     public List<HasWord> getTokens() {
//         return tokens;
//     }
// 
//     public void setTokens(List<HasWord> tokens) {
//         this.tokens = tokens;
//     }
// 
// 
//     List<List<SemanticConcept>> semanticConcepts =
//                     new ArrayList<List<SemanticConcept>>();
// 
//     public List<OntologyElement> getAnswerType() {
//         return answerType;
//     }
// 
//     public void setAnswerType(List<OntologyElement> answerType) {
//         this.answerType = answerType;
//     }
// 
//     public POC getFocus() {
//         return focus;
//     }
// 
//     public void setFocus(POC focus) {
//         this.focus = focus;
//     }
// 
//     public Tree getSyntaxTree() {
//         return syntaxTree;
//     }
// 
//     public void setSyntaxTree(Tree syntaxTree) {
//         this.syntaxTree = syntaxTree;
//     }
// 
//     public List<List<SemanticConcept>> getSemanticConcepts() {
//         return semanticConcepts;
//     }
// 
//     public void setSemanticConcepts(List<List<SemanticConcept>> semanticConcepts) {
//         this.semanticConcepts = semanticConcepts;
//     }
// 
//     public List<POC> getPocs() {
//         return pocs;
//     }
// 
//     public void setPocs(List<POC> pocs) {
//         this.pocs = pocs;
//     }
// 
//     public String toString() {
//         StringBuffer b = new StringBuffer("");
//         b.append("sem concepts:");
//         if (this.semanticConcepts != null)
//             b.append(this.semanticConcepts.toString());
//         b.append("pocs:");
//         if (this.pocs != null) b.append(pocs.toString());
//         b.append("Tree:");
//         if (this.syntaxTree != null) b.append(this.syntaxTree.toString());
//         return b.toString();
//     }
// }


// Path: freya/freya-annotate/src/test/java/org/freya/mapping/FocusDemo.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.freya.model.Question;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

package org.freya.mapping;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:META-INF/spring/freya-applicationContext.xml"})
@Configurable
public class FocusDemo {
    
    private static final Log logger = LogFactory.getLog(FocusDemo.class);
    
    @Autowired Mapper mapper;

   // @Test
    public void testMapper() throws Exception {

    	File inFile = new File("src/test/resources/FactualQuestions.txt");
    	File outFile = new File("src/test/resources/FactualQuestions-Focus.csv");
    	//load all questions
    	 PrintStream writer = null;
    	 writer = new PrintStream(outFile);
    	try (BufferedReader br = new BufferedReader(new FileReader(inFile))) {
    	    String line;
    	    while ((line = br.readLine()) != null) {
    	       // process the line.
    	    	Question q = mapper.processQuestion(line, false, null, true);