Package uk.ac.cam.ch.wwmm.oscar3server.scrapbook

Examples of uk.ac.cam.ch.wwmm.oscar3server.scrapbook.ScrapBook


  private void setScrapBook(String name) throws Exception {
    if(name == null || name.length() == 0) scrapBook = null;
    if(scrapBooks.containsKey(name)) {
      scrapBook = scrapBooks.get(name);
    } else {
      scrapBook = new ScrapBook(name);
      scrapBooks.put(name, scrapBook);
    }
  }
View Full Code Here


      /*Serializer ser = new Serializer(System.out);
      ser.setIndent(2);
      ser.write(doc);*/
      Serializer ser = new Serializer(new FileOutputStream(f));
      ser.write(doc);
      ScrapBook sb = new ScrapBook(f.getParentFile());
      sb.makePaper();
    }
   
  }
View Full Code Here

    //System.out.println();
    System.out.println(f);
    //System.out.println(StringTools.multiplyString("=", f.toString().length()));
    //System.out.println();
   
    ScrapBook sb = new ScrapBook(f.getParentFile());
    Document doc = (Document)sb.getDoc().copy();
    Nodes nodes = doc.query("//cmlPile");
    for(int i=0;i<nodes.size();i++) nodes.get(i).detach();
    Document sourceDoc = (Document)doc.copy();
    nodes = sourceDoc.query("//ne");
    for(int i=0;i<nodes.size();i++) {
View Full Code Here

    return foldList;
  }
 
  public static void handleElems(List<Element> elems, String suffix) throws Exception {
    System.out.println("Elems: " + elems.size());
    ScrapBook sb = new ScrapBook("paragraphs" + suffix, true);
    for(Element e : elems) {
      sb.addScrap(e, null);
    }
  }
View Full Code Here

    List<Event> events = new ArrayList<Event>();
   
    List<BagEvent> eventBags = new ArrayList<BagEvent>();
   
    for(File f : files) {
      ScrapBook sb = new ScrapBook(f.getParentFile());
      Document doc = (Document)sb.getDoc().copy();
      Nodes nodes = doc.query("//cmlPile");
      for(int i=0;i<nodes.size();i++) nodes.get(i).detach();
      Document sourceDoc = (Document)doc.copy();
      nodes = sourceDoc.query("//ne");
      for(int i=0;i<nodes.size();i++) {
View Full Code Here

  private State setPaper(File f) throws Exception {
    State state = new State();
    if(Oscar3Props.getInstance().verbose) System.out.println("Setting: " + f);
    if(new File(f, "scrapbook.xml").exists()) {
      if(new File(f, "source.xml").exists()) {
        ScrapBook sb = new ScrapBook(f);
        sb.makePaper();
        state.safDoc = new Builder().build(new File(f, "saf.xml"));
        state.sourceDoc = new Builder().build(new File(f, "source.xml"));             
      } else {
        ScrapBook sb = new ScrapBook(f);
        Document doc = (Document)sb.getDoc().copy();
        Nodes nodes = doc.query("//cmlPile");
        for(int i=0;i<nodes.size();i++) nodes.get(i).detach();
        state.sourceDoc = (Document)doc.copy();
        nodes = state.sourceDoc.query("//ne");
        for(int i=0;i<nodes.size();i++) {
View Full Code Here

    //System.out.println();
    System.out.println(f);
    //System.out.println(StringTools.multiplyString("=", f.toString().length()));
    //System.out.println();
   
    ScrapBook sb = new ScrapBook(f.getParentFile());
    Document doc = (Document)sb.getDoc().copy();
    Nodes nodes = doc.query("//cmlPile");
    for(int i=0;i<nodes.size();i++) nodes.get(i).detach();
    Document sourceDoc = (Document)doc.copy();
    nodes = sourceDoc.query("//ne");
    for(int i=0;i<nodes.size();i++) {
View Full Code Here

   
    Bag<String> wordsWithReact = new Bag<String>();
    Bag<String> wordsWithoutReact = new Bag<String>();
   
    for(File f : files) {
      ScrapBook sb = new ScrapBook(f.getParentFile());
      Document doc = (Document)sb.getDoc().copy();
      Nodes nodes = doc.query("//cmlPile");
      for(int i=0;i<nodes.size();i++) nodes.get(i).detach();
      Document sourceDoc = (Document)doc.copy();
      nodes = sourceDoc.query("//ne");
      for(int i=0;i<nodes.size();i++) {
View Full Code Here

TOP

Related Classes of uk.ac.cam.ch.wwmm.oscar3server.scrapbook.ScrapBook

Copyright © 2018 www.massapicom. 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.