Ejemplo n.º 1
0
 def init_data(self):
     dictionary = self.dictionary
     # initialize progress with all (0, 0) (short, long) memory
     for level in dictionary.levels:
         for word in dictionary.level_words(level):
             key = dictionary.kana(word)
             self.progress_data[key] = (0, 0)
             self.origin_map[key] = dictionary.origin(word)
             self.romji_map[key] = dictionary.romaji(word)
Ejemplo n.º 2
0
 def learn_one_round(self):
     for word in self.words:
         prompt = dictionary.kana(word)
         if self.show_origin:
             prompt += "  " + dictionary.origin(word)
         user_input = input(prompt).strip()
         romaji = dictionary.romaji(word)
         if user_input != romaji:
             print('it should be ' + romaji)
Ejemplo n.º 3
0
    def learn_one_round(self):
        for word in self.words:
            prompt = dictionary.romaji(word)
            if self.show_origin:
                prompt += "  " + dictionary.origin(word)

            kana = dictionary.kana(word)
            choices = '    '.join(self.get_choices(self.all_kana, kana))
            user_input = input(prompt + '\n' + choices).strip()

            if user_input != kana:
                print('it should be ' + kana)