squallstar / gakusei

Non-AI Meteor-powered language learning tool
http://learn.fragments.me
GNU General Public License v2.0
22 stars 4 forks source link

Allowing multiple acceptable versions for translations #25

Open scriptin opened 8 years ago

scriptin commented 8 years ago

Some phrases can be translated in multiple ways in both directions.

For example, 「…ですか。」 vs 「…です?」. Both are valid endings for questions, since question mark is a real thing in modern Japanese.

Another common examples are omitting 「私は…」 in front of some statements or changing positions of various parts of a phrase, e.g. in "{{name}}{{suffix}}は{{transport}}で{{place}}に{{verb-direction}}。" these "to" and "by" parts can be in a different order.

I think that the format can be changed into something like that:

{
  "english": [
    "{{suffix}} {{name}} is {{verb-direction}} to {{place}} by {{transport}}."
  ],
  "japanese": [
    {
      "romaji": "{{name}}{{suffix}} wa {{transport}} de {{place}} ni {{verb-direction}}.",
      "kana": "{{name}}{{suffix}}は{{transport}}で{{place}}に{{verb-direction}}。"
    },
    {
      "romaji": "{{name}}{{suffix}} wa {{place}} ni {{transport}} de {{verb-direction}}.",
      "kana": "{{name}}{{suffix}}は{{place}}に{{transport}}で{{verb-direction}}。"
    }
  ],
  "story": "travelling"
},

I replaced strings with arrays, and merged "romaji" and "kana" into objects. I haven't really think that through, so maybe the format should be different, but the idea is to provide multiple acceptable versions of both English and Japanese phrases.

squallstar commented 8 years ago

@scriptin it's definitely a good idea to allow multiple sentences to be correct, though it will require some changes to the logic that generates a question and also the one that validates an answer as correct. I'll have some thoughts one of these evenings and see what I can do based on your suggestions :-)

Thanks

scriptin commented 8 years ago

Also, I thought it would be nice to add an optional comment to each romaji+kana record. For example, when user enters a phrase starting with 「私は…」 when it's not necessary, comment should say something like "You should omit the pronoun (私は…), because it's obvious from the context". That way the app can teach users how to construct most natural sentences, while still allowing every grammatically-correct versions.