Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting into Java: French Verb Conjugation Program
#20
do-while looks and reads better.

Check for legal tense right after it test for length. I can easily update the tense list without having to fiddle with this part. This will make it easy to support both English and French tense names.
Code:
boolean matchFound = false;
                int i = 0;
                do {
                    if (supportedTenses[i++].equals(tense)){
                        matchFound = true;
                        break;
                    }
                } while( !matchFound || i < supportedTenses.length);
                
                if (!matchFound){
                    continue;
                }
I have it loop to print all of the conjugations so that I can see if it is conjugating properly without entering each pronoun by hand. The end goal is a program that can function like flash cards. It would work like Stereo suggested, "Il aller imperfect" as an output and if you enter "Il allait", you get happy applause.

I am not entirely sure how to conjugate reflexive verbs because we have not gotten there yet, but that should be just a Google Search or two away. Dual conjugation would be cool, but towards my goal of flash cards I am not sure it would be useful.
Reply


Messages In This Thread
Getting into Java: French Verb Conjugation Program - by Hazzy - 2010-10-20, 07:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)