Examples of Tmx


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

    this.sourceLanguageCode = sourceLanguageCode;
    this.targetLanguageCode = targetLanguageCode;
  }

  public void format(List<Alignment> alignmentList) {
    Tmx tmx = new Tmx();
    tmx.setVersion(TMX_VERSION);
    Header header = new Header();
    header.setAdminlang(TMX_ADMINLANG);
    header.setSrclang(sourceLanguageCode);
    header.setCreationtool(TMX_CREATIONTOOL);
    header.setCreationtoolversion(TMX_CREATIONTOOLVERSION);
    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

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

   * Parses TMX document into alignment list.
   * @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 =
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.