Package uk.ac.cam.ch.wwmm.ptclib.misc

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.StringGISModelWriter


  public Element writeElement() throws Exception {
    Element root = new Element("rescorer");
    for(String type : modelsByType.keySet()) {
      Element maxent = new Element("maxent");
      maxent.addAttribute(new Attribute("type", type));
      StringGISModelWriter sgmw = new StringGISModelWriter(modelsByType.get(type));
      sgmw.persist();
      maxent.appendChild(sgmw.toString());
      root.appendChild(maxent);

    }
    return root;
  }
View Full Code Here


  public Element writeModel() throws Exception {
    Element root = new Element("memm");
    for(String prev : gmByPrev.keySet()) {
      Element maxent = new Element("maxent");
      maxent.addAttribute(new Attribute("prev", prev));
      StringGISModelWriter sgmw = new StringGISModelWriter(gmByPrev.get(prev));
      sgmw.persist();
      maxent.appendChild(sgmw.toString());
      root.appendChild(maxent);
    }
    if(rescorer != null) {
      root.appendChild(rescorer.writeElement());
    }
View Full Code Here

    System.out.println(gis.getIndex("FOO"));
    if(true) return;
   
   
    long time = System.currentTimeMillis();
    StringGISModelWriter sgmw = new StringGISModelWriter(gis);
    sgmw.persist();
    String modelStr = sgmw.toString();

    //System.out.println(modelStr);
   
    StringGISModelReader sgmr = new StringGISModelReader(modelStr);
    gis = sgmr.getModel();
View Full Code Here

    Element e = new Element("subtypes");
    for(String type : classifiers.keySet()) {
      Element c = new Element("classifier");
      e.appendChild(c);
      c.addAttribute(new Attribute("type", type));
      StringGISModelWriter sgmw = new StringGISModelWriter(classifiers.get(type));
      sgmw.persist();
      //System.out.println(sgmw.toString());
      c.appendChild(sgmw.toString());
    }
    return e;
  }
View Full Code Here

TOP

Related Classes of uk.ac.cam.ch.wwmm.ptclib.misc.StringGISModelWriter

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.