Package net.sourceforge.align.util.bind.tmx

Examples of net.sourceforge.align.util.bind.tmx.Body


    header.setSegtype(TMX_SEGTYPE);
    header.setDatatype(TMX_DATATYPE);
    header.setOTmf(TMX_OTMF);
    header.setCreationdate(DateParser.getIsoDateNoMillis(new Date()));
    tmx.setHeader(header);
    Body body = new Body();
    for (Alignment alignment : alignmentList) {
      Tu tu = new Tu();
      createTuv(tu, sourceLanguageCode, alignment.getSourceSegmentList());
      createTuv(tu, targetLanguageCode, alignment.getTargetSegmentList());
      if (tu.getTuv().size() > 0) {
        body.getTu().add(tu);
      }
    }
    tmx.setBody(body);
    TmxMarshallerUnmarshaller.getInstance().marshal(tmx, writer);
  }
View Full Code Here


   * @return alignment list
   */
  public List<Alignment> parse() {
    List<Alignment> alignmentList = new ArrayList<Alignment>();
    Tmx tmx = TmxMarshallerUnmarshaller.getInstance().unmarshal(reader);
    Body body = tmx.getBody();
    if (sourceLanguageCode == null && targetLanguageCode == null) {
      initLanguageCodes(body.getTu());
    }
    for (Tu tu : body.getTu()) {
      List<String> sourceSegmentList =
        createSegmentList(tu, sourceLanguageCode);
      List<String> targetSegmentList =
        createSegmentList(tu, targetLanguageCode);
      //Ignore empty alignments
View Full Code Here

TOP

Related Classes of net.sourceforge.align.util.bind.tmx.Body

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.