Home

Awesome

Project to learn different natural languages (English, Polish and so on) using mnemonic rules with Java code

This is project for use mnemonic rules as programing code to learn grammar rules of different natural languages (English, Polish and so on):

For example, a mnemonic rule for all Past tense in English using Java code is just:

    switch (tenseForms) {
        case SIMPLE:
            return pronoun + verb + "ed";
        case CONTINUOUS:
            return pronoun + (pronoun == I || pronoun == HE_SHE_IT? WAS: WERE) + verb + "ing";
        case PERFECT:
            return pronoun + HAD + verb + "ed";
        case PERFECT_CONTINUOUS:
            return pronoun + HAD + BEEN + verb + "ing";
    }        
    

It's may be easy way to learn grammar for programmer then traditional method.

Positive sentence

TenseSimpleContinuousPerfectPerfect Continuous
Pastpronoun + verb + "ed"`pronoun + (pronoun == Ipronoun == HE_SHE_IT? WAS: WERE) + verb + "ing"`
Presentpronoun + verb + (pronoun == HE_SHE_IT ? "s" : "")pronoun + (pronoun == I ? AM : pronoun == HE_SHE_IT ? IS : ARE) + verb + "ing"pronoun + (pronoun == HE_SHE_IT ? HAS: HAVE) + verb + "ed"pronoun + (pronoun == HE_SHE_IT ? HAS: HAVE) + BEEN + verb + "ing"
Futurepronoun + WILL + verbpronoun + WILL + BE + verb + "ing"pronoun + WILL + HAVE + verb + "ed"pronoun + WILL + HAVE + BEEN + verb + "ing"
Future In Pastpronoun + WOULD + BE + verb + "ing"pronoun + WOULD + BE + verb + "ing"pronoun + WOULD + HAVE + verb + "ed"pronoun + WOULD + HAVE + BEEN + verb + "ing"

Negative sentence

TenseSimpleContinuousPerfectPerfect Continuous
Pastpronoun + DID +"not " + verb`pronoun + (pronoun == Ipronoun == HE_SHE_IT? WAS: WERE) + "not " + verb + "ing"`
Presentpronoun + (pronoun == HE_SHE_IT ? DOES : DO) + "not " + verbpronoun + (pronoun == I ? AM : pronoun == HE_SHE_IT ? IS : ARE) + "not " + verb + "ing"pronoun + (pronoun == HE_SHE_IT ? HAS: HAVE) + "not " + verb + "ed"pronoun + (pronoun == HE_SHE_IT ? HAS: HAVE) + "not " + BEEN + verb + "ing"
Futurepronoun + WILL + "not " + verbpronoun + WILL + "not " + BE + verb + "ing"pronoun + WILL + "not " + HAVE + verb + "ed"pronoun + WILL + "not " + HAVE + BEEN + verb + "ing"

Questions

TenseSimpleContinuousPerfectPerfect Continuous
PastDID + pronoun + verb + "?"`(pronoun == Ipronoun == HE_SHE_IT? WAS: WERE) + pronoun + verb + "ing?"`
Present(pronoun == HE_SHE_IT ? DOES : DO) + pronoun + verb + "?"(pronoun == I ? AM : pronoun == HE_SHE_IT ? IS : ARE) + pronoun + verb + "ing?"(pronoun == HE_SHE_IT ? HAS: HAVE) + pronoun + verb + "ed?"(pronoun == HE_SHE_IT ? HAS: HAVE) + pronoun + BEEN + verb + "ing?"
FutureWILL + pronoun + verb + "?"WILL + pronoun + BE + verb + "ing?"WILL + pronoun + HAVE + verb + "ed?"WILL + pronoun + HAVE + BEEN + verb + "ing?"

Passive

TenseSimpleContinuousPerfect
Past`pronoun + (pronoun == Ipronoun == HE_SHE_IT? WAS: WERE) + verb + "ed"`
Presentpronoun + (pronoun == I ? AM : pronoun == HE_SHE_IT ? IS : ARE) + verb + "ed"pronoun + (pronoun == I ? AM : pronoun == HE_SHE_IT ? IS : ARE) + BEING + verb + "ed"pronoun + (pronoun == HE_SHE_IT ? HAS: HAVE) + BEEN + verb + "ed"
Futurepronoun + WILL + BE + verb + "ed"NULLpronoun + WILL + HAVE + BEEN + verb + "ed"

FutureInPast

    switch (tenseForms) {
        case SIMPLE:
            return pronoun + WOULD + verb;
        case CONTINUOUS:
            return pronoun + WOULD + BE + verb + "ing";
        case PERFECT:
            return pronoun + WOULD +  HAVE + verb + "ed";
        case PERFECT_CONTINUOUS:
            return pronoun + WOULD +  HAVE + BEEN + verb + "ing";
    }
    

Conditions

    if(condition == REAL) {
        if(tense == PRESENT || tense == FUTURE) { // FirstCondition
            verdInMainStatement = convertToFuture(verdInMainStatement);
            verdInSecondStatement = convertToPresent(verdInSecondStatement);
        } else {
            throw new IllegalStateException(); // Condition isn't exist
        }
    } else if(condition == UNREAL) {
        if(tense == PRESENT || tense == FUTURE) { // SecondCondition
            verdInMainStatement = SHOULD + verdInMainStatement;
            verdInSecondStatement = verdInSecondStatement.equals("be")? WERE:
                    (verdInSecondStatement + "ed");
        } else { // ThirdCondition
            verdInMainStatement = SHOULD + (pronoun == HE_SHE_IT ? HAS: HAVE) +
                    verdInMainStatement + "ed";
            verdInSecondStatement = HAD + verdInSecondStatement + "ed";
        }
    } else {
        throw new IllegalStateException(); // Condition isn't exist
    }
    
    

More info for English see this

P.S. I'll happy if you add new natural and programm languages to this project.