Giter Site home page Giter Site logo

tmxt's Introduction

tmxt

This tool consists on two scripts:

  • tmxplore.py, a script to determine the language codes available inside a particular TMX file by looking to an excerpt or even the whole file.
  • tmxt.py, to effectively transform a TMX to a tab-separated text file using the language code list provided in the command. TU propierties can also be printed if requested.

Requirements

Requires python3 and the libraries included in requirements.txt

Examples of usage

tmxplore.py

$ python3 tmxplore.py file.tmx
en es

or

$ cat file.tmx | python3 tmxplore.py
en es

tmxt.py

$ python3 tmxt.py --codelist en,fr tm.fr-en.tmx en-fr.txt

Other

$ zcat largefile.tmx.gz | python3 tmxt.py --codelist en,es |gzip > bitext.en-es.gz

Printing TU propierties

$ python3 tmxt.py --codelist en,fr,prop1,prop2 tm.fr-en.tmx en-fr.txt

tmxt's People

Contributors

sortiz avatar zjaume avatar zuny26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tmxt's Issues

Incorrect output on multilingual TMX files

The Khresmoi TMX file from https://elrc-share.eu/repository/download/4a377a8c0a2811e9b7d400155d026706eba6a605cd32407d9216ad32f64e398e/

looks like

<?xml version="1.0" encoding="utf-8"?>
<tmx version="1.4">
        <header creationtool="WB_Python" creationtoolversion="1.0" o-tmf="WB" segtype="sentence" adminlang="en-GB" srclang="en-GB" datatype="xml" creationdate="20181205T073750Z">
        </header>
        <body>
                <tu tuid="1" srclang="en-GB">
                        <tuv xml:lang="en-GB">
                                <seg>The aim of this study was to investigate the effect of in vivo inhibition of factor XI and TAFI in an experimental thrombosis model in rabbits.</seg>
                        </tuv>
                        <tuv xml:lang="de-DE">
                                <seg>Das Ziel dieser Studie war die Erforschung der Auswirkung einer in-vivo-Hemmung von Faktor XI und TAFI in einem experimentellen Thrombose-Modell bei Kaninchen.</seg>
                        </tuv>
                </tu>
                <tu tuid="2" srclang="en-GB">
                        <tuv xml:lang="en-GB">
                                <seg>The aim of this study was to investigate the effect of in vivo inhibition of factor XI and TAFI in an experimental thrombosis model in rabbits.</seg>
                        </tuv>
                        <tuv xml:lang="fr-FR">
                                <seg>Le but de cette étude était d"étudier l'effet de l'inhibition in vivo de facteur XI et TAFI dans un modèle expérimentale de thrombose chez les lapins.</seg>
                        </tuv>
                </tu>

and this tool is producing The aim of this study was to investigate the effect of in vivo inhibition of factor XI and TAFI in an experimental thrombosis model in rabbits. repeatedly with blank German when another language appears.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.