コード例 #1
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate
from python_utils.html_generator import getHtmlString
from python_utils.model import TextPair, HighlightText, Color
from python_utils.vocab_list import generateVocabLines

with open('volitional_form_+_toomotteimasu.md', 'w', encoding="utf-8") as f:
    toomotteimasu = getHtmlString("と 思っています")

    f.write(printTitle('Usage Form'))
    f.write(
        generateCard('V volitional form +' + toomotteimasu,
                     [('light_green', 'V volitional form'),
                      ('light_pink', toomotteimasu)]))
    writeNewLine(f)

    f.write(printTitle('Prerequisite'))
    f.write(
        f'Please see [these rules](volitional_form.md) if you want to know how to do verb conjugation for volitional form.'
    )
    writeNewLine(f)
    f.write(printTitle('Explanation'))
    f.write(
        f"You can use the volitional form with {toomotteimasu} to express what the speaker is thinking of doing. Note that when you use this expression, the decision of doing something was made some time ago. You can also use to express a third person's will or intention."
    )

    f.write(printTitle('Examples'))

    f.write('<b>Example A</b>')
    f.write('<br>')
    l1 = TextPair('週末は 海に 行こうと思っています。',
                  "I am thinking of going to the beach at the weekend.", [
コード例 #2
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate
from python_utils.html_generator import getHtmlString
from python_utils.model import TextPair, HighlightText, Color
from python_utils.vocab_list import generateVocabLines

with open('~taradoudesuka.md', 'w', encoding="utf-8") as f:

    f.write(printTitle('Usage Form'))
    cardText = 'V past form + らどうですか'

    f.write(generateCard(cardText, []))

    f.write(printTitle('Explanation'))
    f.write(
        "This form conveys advice or recommendation but it may also have a criticizing tone for not performing the activity that should have done already."
    )
    f.write(printTitle('Examples'))

    f.write('<b>Example A</b>')
    f.write('<br>')
    furigana = getHtmlString("勉強する")
    furigana1 = getHtmlString("勉強した")
    furigana3 = getHtmlString("勉強したらどうですか")
    f.write(
        f'{furigana} --> [convert to past tense] --> {furigana1} --> [combine with らどうですか] --> {furigana3} '
    )
    l1 = TextPair('もっと勉強したらどうですか。',
                  "Why don't you study harder?", [
                      HighlightText('勉強した', Color.LIGHT_GREEN),
                      HighlightText('らどうですか', Color.LIGHT_PINK)
                  ],
コード例 #3
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.vocab_list import generateVocabLines

# For subsequent actions and subsequent events,
# Do something in advance

with open('v_te-form_okimasu.md', 'w') as f:
    f.write(printTitle('Usage Form'))
    f.write('\n')
    f.write(
        generateCard('V て-form + おきます', [('light_green', 'V て-form'),
                                         ('light_pink', 'おきます')]))
    f.write('\n')

    f.write((printTitle('To do something in advance; Preparation')))
    writeNewLine(f)

    l1 = TextPair('旅行の 前に切符を 買って おきます。',
                  'I will buy a ticket before the trip.', [
                      HighlightText('買って', Color.LIGHT_GREEN),
                      HighlightText('おきます', Color.LIGHT_PINK)
                  ],
                  addBullet=True)
    f.write(generate([l1]))
    writeNewLine(f)

    l1 = TextPair('来週までにレポートを書いておきます。',
                  'I will write a report by next week.', [
                      HighlightText('書いて', Color.LIGHT_GREEN),
コード例 #4
0
    f.write(
        'The `たら` (tara) form can also be used for expressing a conditional. In order to use `たら` (tara) form, we need to use know how to convert dictionary form to past tense form. Please see how to change to past tense [here](past_tense_form.md).'
    )

    f.write('\n')
    f.write(
        getInfoBlock(
            "When you use `たら` (tara), it is usually express the speaker's will; even pure hypothetical condition."
        ))
    f.write('\n')

    f.write(printTitle('Conjugation Rule for たら (tara)'))
    cardText = 'Change the noun, adjective, or verb to its past tense and attach `ら` (ra) to it.'

    f.write(generateCard(cardText, [], useLeft=True))

    f.write('<br>')
    f.write('<b>Example A : Verb</b>')
    f.write('<br>')
    l1 = TextPair(
        '東京へ 来たら、 ぜひ連絡して ください。',
        "Please contact me when you come to Tokyo.",
        [
            HighlightText('来た', Color.LIGHT_GREEN),
            HighlightText('ら', Color.LIGHT_PINK, replaceAt=1)
        ],
        addBullet=True,
    )
    f.write(generate([l1]))
    writeNewLine(f)
コード例 #5
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, generateGridContainer
from python_utils.model import TextPair, HighlightText, Color, FuriganaGridItem
from python_utils.vocab_list import generateVocabLines

with open('volitional_form_+_question_particle_ka.md', 'w',
          encoding="utf-8") as f:

    f.write(printTitle('Usage Form'))
    f.write(
        generateCard('V volitional form +' + ' ' + 'か',
                     [('light_green', 'V volitional form'),
                      ('light_pink', 'か')]))
    writeNewLine(f)

    f.write(printTitle('Prerequisite'))
    f.write(
        f'Please see [these rules](volitional_form.md) if you want to know how to do verb conjugation for volitional form.'
    )
    writeNewLine(f)

    f.write(printTitle('Explanation'))
    f.write(
        'You can use the volitional form with the question particle `か` to ask for an opinion in your offer or suggestion.'
    )

    f.write((printTitle('Examples')))

    # we need to add this dummy. otherwise, there is brake line between explanation and example sentence
    l1 = TextPair(
        '',
        '',