GithubHelp home page GithubHelp logo

bidiread's People

Contributors

jzohrab avatar nsbum avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

nsbum

bidiread's Issues

Add simple DeepL auto-translation`

Summary

Would be super to have a button to create simple machine translations of text using DeepL's service

DeepL

DeepL has a paid API, but this could potentially just use their regular web page, called via javascript. They throttle excessive calls, so calls would need to be timed/throttled/limited.

Outline, possible solution

Add js methods with tape tests:

  • makeChunks(srctext, maxsize=5000): take paragraphs from srctext, and join them into chunks of maxsize, breaking on paragraphs. Returns array of paras, eg "a \n b \n c" => [ "a \n b", "c" ] for maxsize 2. Could potentiallyyield results.
  • getSingleTranslation(txt, srclang, destlang): call DeepL web page with some text, scrape the result, and return the text. src and dest langs are the deepL available languages.
  • getTranslation(txt, srclang, destlang, updateCallback): main method, breaks txt into chunks and translates each. Needs to throttle the calls to getSingleTranslation, perhaps limit them. updateCallback is to update some UI or console, to track progress.

If we need to use a node library, that should be ok, Parcel should hopefully be able to bundle things correctly.

Add UI:

  • not sure of design -- maybe a button on the main page above the text box, which lets you deepl translate from the other text box
  • when click button, add a "translating ... " div, perhaps showing the start of the current chunk being translated, and a progress meter. Translating ... 90% done ("Cuando era niño, mi madre siempre me decía ..."), and append the data to the destination box
  • add notes about auto translation to menu, warning about throttling and how to deal with it

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.