package ever.pipeline; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import javax.xml.stream.XMLStreamException; /** * This class parses the different result files from sundance and loads them into the structures * */ public class SundanceResult { /** * Case Frame File constructed by Sundance */ private File input; private File original; private String output; /** * Segementer File constructed by sundance */ private File seg=null; //@param exRes the file which contains the Result from the Sundance information extraction process public SundanceResult(File exRes, File seg, File original, String out) { input=exRes; this.original=original; this.seg=seg; this.output=out; } /** * * @return extracts possible ingredients, tasks etc * @throws FileNotFoundException * @throws XMLStreamException */ public void parseCF() throws FileNotFoundException, XMLStreamException { Scanner sc = new Scanner(input); sc.useDelimiter("[*]{46}"); //Skip part with MIMEType sc.next(); //Read second output of sundance the segmentation file Scanner clauseScanner=new Scanner(seg); clauseScanner.useDelimiter("Original : "); while(sc.hasNext()) { String tmp = sc.next(); String clause = clauseScanner.next(); Sentence s= new Sentence(tmp,clause); } } }