示例#1
0
def start():
    cur_chapter = CHAPTER
    atype = DEFAULT_ADJECTIVE_TYPE
    particle = DEFAULT_ADJECTIVE_PARTICLE
    db = load_from_json(FILE, WE_ARE)
    print("Currently at {} words".format(len(db)))
    while True:
        english, kana, kanji, chapter, cur_chapter = get_basics(cur_chapter)
        if not english:
            break
        atype = get_type(atype)
        particle = get_particle(particle)
        entry = {'english': english, 'kana': kana, 'chapter': chapter}
        if kanji:
            entry['kanji'] = kanji

        # Specific to adjectives
        if particle is not None:
            entry['particle'] = particle
        entry['type'] = atype
        # End specific to verbs

        if confirm(entry):
            db.append(entry)
    save_to_json(FILE, {WE_ARE: db})
def start():
    cur_chapter = CHAPTER
    db = load_from_json(FILE, WE_ARE)
    print("Currently at {} words".format(len(db)))
    while True:
        english, kana, kanji, chapter, cur_chapter = get_basics(cur_chapter)
        if not english:
            break
        entry = {'english': english, 'kana': kana, 'chapter': chapter}
        if kanji:
            entry['kanji'] = kanji
        if confirm(entry):
            db.append(entry)
    save_to_json(FILE, {WE_ARE: db})
示例#3
0
def start():
    cur_chapter = CHAPTER
    cur_preposition_type = DEFAULT_PREPOSITION_TYPE
    db = load_from_json(FILE, WE_ARE)
    print("Currently at {} words".format(len(db)))
    while True:
        english, kana, kanji, chapter, cur_chapter = get_basics(cur_chapter)
        if not english:
            break
        entry = {'english': english, 'kana': kana, 'chapter': chapter}
        if kanji:
            entry['kanji'] = kanji

        # Specific to prepositions
        cur_preposition_type = set_preposition_type(entry,
                                                    cur_preposition_type)

        if confirm(entry):
            db.append(entry)
    save_to_json(FILE, {WE_ARE: db})