GithubHelp home page GithubHelp logo

wlevine / translation_interleaver Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 109 KB

Correlate sentences between a source text and a human translated version of that text, using machine translation

License: MIT License

Ruby 4.21% HTML 95.79%

translation_interleaver's Introduction

This is a tool for displaying a text together with its translation so that each sentence from the source text is followed by its translation.

You provide a source text and a (human) translated text and machine translation is used to correlate sentences between the two texts and then display the two texts interleaved.

Here is an example of the output. Unfortunately it gets the first sentence wrong, but other than that it does pretty well.

This tool requires the bing_translator gem and the pragmatic_segmenter gem.

Before running, you will need a (free) Client ID and secret for Microsoft translator.

How to run:

./translate.rb -i texts/underground_chap1_ru.txt -o texts/gen_underground_chap1.yaml -s ru -t en -c [client_id] -k [secret]
./interleave.rb -y texts/gen_underground_chap1.yaml -m texts/underground_chap1_en.txt -o texts/gen_underground_chap1.html -t en

The sample texts in the texts/ directory are all public domain. The code is under the MIT license.

Caveats:

TODO:

translation_interleaver's People

Contributors

wlevine avatar

Stargazers

 avatar Kevin Dias avatar

Watchers

James Cloos avatar  avatar

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.