Examples of runFlow()


Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

    })) {
      try {
        String contents = FileUtils.readFileToString(f);
        SciXMLDocument doc = TextToSciXML.textToSciXML(contents);
        OscarFlow flow = new OscarFlow(doc);
        flow.runFlow("recognise resolve");
        if (++count > 200)
          break;
      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

   
    Document doc = null;
    try {
      doc = ToSciXML.fileToSciXML(file);
      OscarFlow oscarFlow = new OscarFlow(doc);
      oscarFlow.runFlow(flow);
      if (oscarFlow.getDataXML() != null) writeDoc(oscarFlow.getDataXML(), file.getName(), "data.xml");
      if (oscarFlow.getGeniaSAF() != null) writeDoc(oscarFlow.getGeniaSAF(), file.getName(), "genia.xml");
      if (oscarFlow.getInlineXML() != null) writeDoc(oscarFlow.getInlineXML(), file.getName(), "inline.xml");
      if (oscarFlow.getRelationXML() != null) writeDoc(oscarFlow.getRelationXML(), file.getName(), "relation.xml");
      if (oscarFlow.getSafXML() != null) writeDoc(oscarFlow.getSafXML(), file.getName(), "saf.xml");
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

    try {
      String contents = FileUtils.readFileToString(new File("test.html"));
      SciXMLDocument doc = TextToSciXML.textToSciXML(HtmlCleaner
          .cleanHTML(contents));
      OscarFlow flow = new OscarFlow(doc);
      flow.runFlow("recognise resolve");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

        }

        public void autoAnnotate() throws Exception {
                        clearAnnotations();
                        OscarFlow oscarFlow = new OscarFlow(doc);
                        oscarFlow.runFlow("recognise inline");
                        doc = ARTSciXMLDocument.makeFromDoc(oscarFlow.getInlineXML());
                        writeScrapBook();
               
                        // Adapt this and clear annotations for mode 2
                        // need a SciXMLDocument object from mode2.xml using Builder
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

        }
       
        public ARTSciXMLDocument autoAnnotate2() throws Exception {
                clearAnnotations2();
                OscarFlow oscarFlow = new OscarFlow(doc2);
                oscarFlow.runFlow("recognise inline");
                doc2 = ARTSciXMLDocument.makeFromDoc(oscarFlow.getInlineXML());
                writeMode2Doc(doc2);
                return doc2;
        }
       
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

      OscarFlow oscarFlow = new OscarFlow(plainDoc);
     
      if(request.getParameter("flowcommand") != null &&
          request.getParameter("flowcommand").trim().length() > 0) {
        oscarFlow.runFlow(request.getParameter("flowcommand"));
      } else if(outputMode.equals("data")) {
        oscarFlow.parseData();
      } else {
        oscarFlow.processLite();
      }
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

    String s = rg.getString("testcard.txt");
    assertTrue("Have testcard string", s != null && s.length() > 0);
    Document doc = TextToSciXML.textToSciXML(s);
    assertTrue("Have SciXML document", doc != null);
    OscarFlow flow = new OscarFlow(doc);
    flow.runFlow("recognise resolve numbersaf inline data");
    assertNotNull("Have source XML", flow.getSourceXML());
    assertNotNull("Have inline XML", flow.getInlineXML());
    assertNotNull("Have SAF XML", flow.getSafXML());
    assertNotNull("Have data XML", flow.getDataXML());
   
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.flow.OscarFlow.runFlow()

 
  public void testTestCard2() throws Exception {
    String s = rg.getString("testcard2.txt");
    Document doc = TextToSciXML.textToSciXML(s);
    OscarFlow flow = new OscarFlow(doc);
    flow.runFlow("recognise resolve");
    assertNotNull("Have SAF XML", flow.getSafXML());
   
    SAFTester tester = new SAFTester(flow.getSafXML());
    assertTrue("Has a CM", tester.atLeastOne(new TypeFilter("CM")));
    assertTrue("Has an ONT", tester.atLeastOne(new TypeFilter("ONT")));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.