Exemple #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.", [
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock, printSecondaryTitle
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock, getCssFlowChartWithThreeBlock
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.table_generator import generateTable
from python_utils.vocab_list import generateVocabLines

with open('conditional_form_ba.md', 'w', encoding="utf-8") as f:
    f.write('When using conditional form, first part of the sentence describes the requirement for something to happen; just like `IF` in English.')

    f.write(printTitle('Prerequisite'))
    f.write(f'Please see [these rules](conditional_form.md) if you want to know how to do verb conjugation for conditional form.')
    writeNewLine(f)
    writeNewLine(f)
    f.write('\n')
    # we need to add this dummy. otherwise, there is brake line between explanation and example sentence
    l1 = TextPair('', '', [], )
    f.write(generate([l1]))

    f.write('<b>Example A : U-Verb</b>')
    f.write('<br>')
    f.write('In this example, we should convert `押す` to `押せ` to get え equivalent sound. And then attach `ば` to obtain the final form `押せば`.')
    l1 = TextPair('ボタンを 押せば、 窓が 開きます。', "If you press the button, the window will open.", [HighlightText('押せ', Color.LIGHT_GREEN), HighlightText('ば', Color.LIGHT_PINK)], addBullet=True,
                  forceReplaceList=[ForceReplace('開き', "あき")])
    f.write(generate([l1]))
    writeNewLine(f)

    f.write('<b>Example B: U-Verb</b>')
    f.write('<br>')
    f.write('In this example, we should convert `行く` to `行け` to get え equivalent sound. And then attach `ば` to obtain the final form `行けば`.')
Exemple #3
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithThreeBlock
from python_utils.model import TextPair, HighlightText, Color
from python_utils.vocab_list import generateVocabLines

with open('conditional_tara_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Conditional - たら (tara) form'))

    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.",
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),
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock
from python_utils.model import TextPair, HighlightText, Color
from python_utils.vocab_list import generateVocabLines

with open('conditional_to_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Conditional - と「to」form'))

    f.write('The `と`「to」form can be used to express the result/event which is predictable and unavoidable due to an action.')

    f.write('\n')
    f.write(getInfoBlock("You <b>cannot</b> use `と` 「to」to express the speaker's wishes, judgement, permission, hopes, requests"))
    f.write('\n')

    f.write(printTitle('Conjugation Rule for と「to」'))
    cardText = 'Sentence: <em>[Condition]</em> `と` <em>[Result]</em> \n \n use <em>present tense short form</em> + `と`'

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

    f.write('<br>')
    f.write('<b>Example A</b>')
    f.write('<br>')
    l1 = TextPair('ここを押すと、ドアが 開きます。', "Press here to open the door.", [HighlightText('押す', Color.LIGHT_GREEN), HighlightText('と', Color.LIGHT_PINK)], addBullet=True, )
    f.write(generate([l1]))
    writeNewLine(f)

    f.write(getCssFlowChartWithTwoBlock(getHtmlString('押す'), 'attach と', getHtmlString('押すと'), ))
    writeNewLine(f)
    f.write('<b>Example B</b>')
    f.write('<br>')
Exemple #6
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock
from python_utils.model import TextPair, HighlightText, Color
from python_utils.vocab_list import generateVocabLines

with open('conditional_nara_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Conditional - なら 「nara」form'))

    f.write('You can use なら 「nara」based on the situation but it is better to explain with examples. Please look at each example with an explanation.')

    f.write('<br>')
    f.write('<br>')
    f.write('<b>Example A</b>')
    f.write('<br>')
    l1 = TextPair('ブラジルに、行ったことがありますか。', 'Have you even been to Brazil?', addBullet=True, )
    l2 = TextPair('チリなら行ったことが, ブラジルは行ったことがありません。', "I've been to Chile, but never been to Brazil.", [HighlightText('なら', Color.LIGHT_GREEN)])
    f.write(generate([l1, l2]))

    f.write('\n')
    f.write(getInfoBlock("The second speaker responded with a contact sentence to show that even though he/she been to Chile, he/she never been to Brazil. "))
    f.write('\n')

    f.write('<br>')
    f.write('<b>Example B</b>')
    f.write('<br>')
    l1 = TextPair('日本語が、わかりますか。', 'Do you understand Japanese?', addBullet=True, )
    l2 = TextPair('ひらがななら わかります。', "if it is (written) in Hiragana, then yes.", [HighlightText('なら', Color.LIGHT_GREEN)])
    f.write(generate([l1, l2]))

    f.write('\n')
Exemple #7
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock, getCssFlowChartWithThreeBlock
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.table_generator import generateTable
from python_utils.vocab_list import generateVocabLines

with open('volitional_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Volitional Form'))
    f.write(
        'The volitional form of a verb is a less formal, more casual equivalent of `ましょう`. You can use it to suggest a plan to a close friend but may not be appropriate to use when you speak with your boss or senior.'
    )
    cardText = '<b>Rule 1:</b> For u-verbs: Replace the u-vowel sound with the お equivalent and attach う' + '\n' + '\n' + \
               '<b>Rule 2:</b> For ru-verbs: Replace る with よう' + '\n' + '\n' + \
               '<b>Rule 3:</b> For exceptions: する becomes しよう and くる becomes こよう'

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

    f.write((printTitle('Rule 1')))
    writeNewLine(f)
    f.write(
        'For u-verbs: Replace the u-vowel sound with the お equivalent and attach う'
    )

    table = generateTable(
        ['Dictionary Form', 'Replacing Method', 'Volitional Form'], [
            [
                getHtmlString("使う"),
                'Replace う with お sound equivalent and attach う',
                getHtmlString("使おう")
            ],
Exemple #8
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
from python_utils.vocab_list import generateVocabLines

with open('v_te-form_iru.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 describe continuous states')))
    writeNewLine(f)

    f.write(
        'You can describe what kind of action is in progress by using the helping verb `ている`.'
    )
    l1 = TextPair('スーさんは 今勉強 しています。',
                  'Sue is studying now.', [
                      HighlightText('して', Color.LIGHT_GREEN),
                      HighlightText('います', Color.LIGHT_PINK)
                  ],
                  addBullet=True)
    f.write(generate([l1]))
    writeNewLine(f)
    writeNewLine(f)
    f.write('You could also add `まだ` to show that the state is on going.')
    l1 = TextPair('まだ 雨が 降っています。',
                  'It is still raining.', [
Exemple #9
0
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock, getCssFlowChartWithThreeBlock
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.table_generator import generateTable
from python_utils.vocab_list import generateVocabLines

with open('conditional_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Conditional Form Conjugation Rules'))
    f.write(
        'In this lesson, we will learn how to change from dictionary form to conditional form to express condition in Japanese.'
    )
    cardText = '<b>Rule 1:</b> For u-verbs: Replace the u-vowel sound with the え equivalent and attach ば' + '\n' + '\n' + \
               '<b>Rule 2:</b> For ru-verbs: Replace る with れば' + '\n' + '\n' + \
               '<b>Rule 3:</b> For verb exceptions: する becomes すれば and くる becomes くらば' + '\n' + '\n' + \
               '<b>Rule 4:</b> For verbs in negative: drop the final い and add ければ' + '\n' + '\n' + \
               '<b>Rule 5:</b> For い-Adj:  Change the last い of the い-adjective into ければ' + '\n' + '\n' + \
               '<b>Rule 6:</b> For な-Adj: Change the last な of the な-adjective and attach なら' + '\n' + '\n' + \
               '<b>Rule 7:</b> For Noun: Attach なら to the noun'

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

    f.write((printTitle('Rule 1')))
    writeNewLine(f)
    f.write(
        'For u-verbs: Replace the u-vowel sound with the え equivalent and attach ば'
    )

    table = generateTable(
        ['Dictionary Form', 'Replacing Method', 'Conditional Form'], [
            [
from python_utils.generator import printTitle, printSecondaryTitle, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.table_generator import generateTable

with open('te_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Verb て-Form (Te-Form)'))
    f.write(
        'Te-forms are a very important part of Japanese grammar. You can use in the following forms.\n \n'
    )
    f.write('- [V て-form + いただけませんか](v_te-form_+_itadakemasenka.md)\n')
    f.write('- [V て-form + います](v_te-form_iru.md)\n')
    f.write('- [V て-form + おきます](v_te-form_okimasu.md)\n')

    f.write((printTitle('Rule 1')))
    f.write('For ru-verbs: Replace る with て')
    table = generateTable(['Dictionary Form', 'Replacing Method', 'て-Form'], [
        [getHtmlString("食べる"), 'Replace る with て',
         getHtmlString("食べて")],
    ])

    f.write(table)

    f.write((printTitle('Rule 2')))
    f.write('For u-verbs: we have 5 subs categories.')
    f.write(printSecondaryTitle('u-verbs with final う, つ and る'))
    f.write('For u-verbs ending with う, つ and る, we should replace with って.')
    table = generateTable(
        ['Dictionary Form', 'Replacing Method', 'て-Form'],
        [[getHtmlString("会う"), 'Replace う with って',
          getHtmlString("会って")],
         [getHtmlString("待つ"), 'Replace つ with って',
Exemple #11
0
from python_utils.generator import printTitle, getInfoBlock, printSecondaryTitle, generateCard
from python_utils.html_generator import getHtmlString
from python_utils.table_generator import generateTable

with open('past_tense_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Past Tense Verb Conjugation Rules'))
    # f.write('In this lesson, we will learn how to form the past and past-negative verbs. You can use in the following forms.\n \n')
    f.write('\n')

    # cardText = '<b>Rule 1:</b> For u-verbs: Replace the u-vowel sound with the お equivalent and attach う' +  '<br>' \
    #            '<b>Rule 2:</b> For ru-verbs: Replace る with よう' + '\n' + '\n' + \
    #            '<b>Rule 3:</b> For exceptions: する becomes しよう and くる becomes こよう'

    cardText = '<b>Rule 1:</b> For ru-verbs: Replace る with た' + '<br>' + \
               '<b>Rule 2:</b> <br> &emsp; For u-verbs ending with う, つ and る: Replace those ending with った' + '<br>' + \
               '&emsp; For u-verbs ending with む, ぶ and ぬ: Replace those ending with んだ' + '<br>' + \
               '&emsp; For u-verbs ending with く: Replace those ending with いて' + '<br>' + \
               '&emsp; For u-verbs ending with ぐ: Replace those ending with いだ' + '<br>' + \
               '&emsp; For u-verbs ending with す: Replace those ending with した' + '<br>' + \
               '&emsp; u-verbs exception: past tense form of 行く is 行った' + '<br>' + \
               '<b>Rule 3:</b> For exceptions: する becomes した and くる becomes きた'

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

    f.write((printTitle('Rule 1')))
    f.write('For ru-verbs: Replace `る` with `た`')
    table = generateTable(
        ['Dictionary Form', 'Replacing Method', 'Past Tense Form'], [
            [getHtmlString("食べる"), 'Replace る with た',
             getHtmlString("食べた")],
        ])
from python_utils.generator import printTitle, generateCard, writeNewLine, generate, getInfoBlock
from python_utils.html_generator import getHtmlString
from python_utils.mermaid_flow_chart_utils import getCssFlowChartWithTwoBlock, getCssFlowChartWithThreeBlock
from python_utils.model import TextPair, HighlightText, Color, ForceReplace
from python_utils.table_generator import generateTable
from python_utils.vocab_list import generateVocabLines

with open('passive_form.md', 'w', encoding="utf-8") as f:
    f.write(printTitle('Passive Form Conjugation Rules'))
    f.write(
        'In this lesson, we will learn how to change from dictionary form to passive form and how to conjugate from passive form to different forms; present; past and て-form.'
    )
    cardText = '<b>Rule 1:</b> For u-verbs: Replace the u-vowel sound with the あ equivalent and attach れる' + '\n' + '\n' + \
               '<b>Rule 2:</b> For ru-verbs: Replace る with られる' + '\n' + '\n' + \
               '<b>Rule 3:</b> For verb exceptions: する becomes される and される becomes こられる' + '\n' + '\n'

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

    f.write((printTitle('Rule 1')))
    writeNewLine(f)
    f.write(
        'For u-verbs: Replace the u-vowel sound with the あ equivalent and attach れる'
    )

    table = generateTable(
        ['Dictionary Form', 'Replacing Method', 'Passive Form'], [
            [
                getHtmlString("使う"),
                'Replace う with the あ equivalent and attach れる',
                getHtmlString("使われる")
            ],