Interlinear texts with LWT

Discussion in 'Language Resources' started by chatchienvache6, Aug 30, 2015.

  1. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    I decided to make a seperate thread about this question. I wanted some help to convert the transcripts of a show into a interlinear transcripts (russian + english) , like the one for the tv show Кухня. I'm having difficulties with LWT, which I installed and made few tests with my own language (french), and it works alright. But I have two problems/questions:

    1) How can I import a russian database terms, so I can directly create the interlinear print, without having to create the terms one by one?

    2) I don't seem to be able to make it work in russian. Russian is not a language by default in the system, so I created it with the default settings. But It just doesn't work after that, I'm unable to create words, to see blue words, etc.

    Any help ?
  2. Big_Dog

    Big_Dog Administrator Staff Member

    Joined:
    Jan 11, 2014
    Messages:
    1,039
    Native Language:
    English
    Advanced Languages:
    Spanish
    Intermediate Languages:
    French, Japanese, Mandarin, Russian, Swahili, Thai
    Basic Languages:
    Korean
    I don't know the answer, but sent a message to member pat tou.
  3. Marine

    Marine Active Member VIP member

    Joined:
    Dec 18, 2014
    Messages:
    88
    Native Language:
    French
    Intermediate Languages:
    English
    Basic Languages:
    Russian
    Pour l'instant, moi non plus je n'ai pas de réponse mais j'essaye aussi le logiciel et aussi pour apprendre le russe, donc on se tient au courant ;)
    Là, je viens juste de l'installer.
  4. Marine

    Marine Active Member VIP member

    Joined:
    Dec 18, 2014
    Messages:
    88
    Native Language:
    French
    Intermediate Languages:
    English
    Basic Languages:
    Russian
    Mes avancements :
    Donc j'ai mis russe dans mes langues grâce au wizard, je n'ai pas eu de problème.
    Puis j'ai importé un texte du site "A taste of russian" avec l'audio.
    Je n'ai pas encore testé l'exportation du vocabulaire vers Anki mais ça ne saurait tarder.

    Attached Files:

    • lwt.jpg
      lwt.jpg
      File size:
      240.1 KB
      Views:
      942
  5. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    Je ne comprends pas pourquoi moi ca ne fonctionne pas. Lorsque j'importe un text en russe, ca ne génère aucun mot. Dans la liste des textes, ca dit "unknown words" zéro.
  6. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    Even if I made it work in russian, I still have the problem of having to translate myself all the words before being able to print it.

    If I don't get an easy way, I intend to write a simple program that will do it. I already did something similar in the past, the only difference was that the translation was not a word-to-word translation, but instead each sentence was translated and place on top of the sentences.
    Last edited: Aug 31, 2015
  7. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    Done. Took me 5 minutes.

    Easy to reproduce.
    1) create an html file
    2) place every word in a ruby element*
    3) ask google chrome to translate! :)

    I could provide the program if people are interested. I should rewrite it in javascript. So if the only purpose of LWT for you is creating interlinear texts, this kind of alternative could be faster.

    *<ruby><span class='notranslate'>{word}</span> <rt>{word}</rt></ruby>
    this part requires programation, because you don't want to do that yourself word by word.


    string pathr = @"....txt";
    string[] slines = System.IO.File.ReadAllLines(pathr, Encoding.UTF8);
    StringBuilder sb = new StringBuilder();
    foreach (string line in slines)
    {
    string[] parts = line.Split(' ');
    foreach (string part in parts)
    {
    if (part.Trim() == string.Empty)
    continue;

    sb.Append("&nbsp;");
    sb.AppendFormat("<ruby><span class='notranslate'>{0}</span> <rt>{0}</rt></ruby>", part);
    }
    sb.Append("<br>");
    }
    string strfinal = sb.ToString();

    Attached Files:

    • mam.jpeg
      mam.jpeg
      File size:
      321.8 KB
      Views:
      974
    Last edited: Aug 31, 2015
    Big_Dog likes this.
  8. Arnaud

    Arnaud Member VIP member

    Joined:
    Jun 18, 2014
    Messages:
    37
    Native Language:
    French
    Intermediate Languages:
    English
    Basic Languages:
    Russian
    Hi, I didn't understand what you've done. I've also zero word translated when I import a text, so how do you go from zero word to a whole translated text. Where do you put the ruby code you've written. Please explain all.
    If you have time, could you write a tutorial so that everybody can reproduce step by step what you've done to obtain an interlinear translation from any text. Thanks in advance.
    Last edited: Sep 1, 2015
  9. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    I'll try to come back soon with a complete solution that requires no understanding and minimum manipulation. Just a paste-text & submit webpage. What I did had nothing to do with LWT, it's an alternative since LWT does not do what I want, and also it requires to install a website with php just for the purpose of using 5% of it's functions.
    Last edited: Sep 1, 2015
  10. chatchienvache6

    chatchienvache6 New Member VIP member

    Joined:
    Jul 28, 2015
    Messages:
    14
    Native Language:
    French
    Advanced Languages:
    English
    Intermediate Languages:
    Japanese
    Basic Languages:
    Russian
    http://jsfiddle.net/okf06y8g/13/

    Sorry for the delay, I finally produce a simple webpage anyone can use to create interlinear texts. This works with chrome.

    1) paste your text in the textarea in the right panel
    2) click the button
    3) in the new window, right-click "Translate to english".

    That's it
    pat tou and Big_Dog like this.
  11. pat tou

    pat tou New Member VIP member

    Joined:
    Jun 30, 2014
    Messages:
    16
    Native Language:
    English, French
    Intermediate Languages:
    Russian
    I'm a little late, but it's great that you made that web page as a solution. What I had done to create the interlinear text in LWT was a python program that split the entire text into words and removed duplicates. It did that for each text file (1 per episode). I then copy + pasted that list to a google spreadsheet with and had a second column with the google translate formula =googletranslate( word , en, ru ...something like that).
    Then I imported the word pairs into LWT but i found it clunky and long to use, so i wrote another python program that took the word pairs and entire text and then wrote the html output with ruby notation. I then converted all those HTML files to pdf with some random freeware, can't remember what it was called. My solution was far from elegant, but it worked for batch processing. I think i'll just use your website for now. hehe. THANKS catdogcow6. I could post the python code if interested.

Share This Page