Logo Search packages:      
Sourcecode: verbiste version File versions

void ModeTensePersonNumber::set ( const char *  modeName,
const char *  tenseName,
int  personNum 
)

Initializes an object from English mode and tense names. Call the set() method.

Parameters:
modeName mode name known to method FrenchVerbDictionary::convertModeName()
tenseName tense name known to method FrenchVerbDictionary::convertTenseName()
personNum person "counter" (1--6, except for imperative mode, where it must be 1--3; ignored for infinitive and participle modes)

Definition at line 32 of file misc-types.cpp.

References mode, person, plural, and tense.

{
    mode = FrenchVerbDictionary::convertModeName(modeName);
    tense = FrenchVerbDictionary::convertTenseName(tenseName);

    if (mode == IMPERATIVE_MODE)
    {
      if (personNum == 1)
      {
          person = 2;
          plural = false;
      }
      else if (personNum == 2)
      {
          person = 1;
          plural = true;
      }
      else if (personNum == 3)
      {
          person = 2;
          plural = true;
      }
      else
      {
          person = 0;
          plural = false;
      }
    }
    else if (mode == INFINITIVE_MODE
            || mode == INVALID_MODE
            || personNum < 1 || personNum > 6)
    {
      person = 0;
      plural = false;
    }
    else if (mode == PARTICIPLE_MODE)
    {
      person = (personNum <= 2 ? 4 : 5);
            // convention: 4=masculine, 5=feminie
      plural = (personNum == 2 || personNum == 4);
    }
    else
    {
      person = (personNum - 1) % 3 + 1;
      plural = (personNum > 3);
    }
}


Generated by  Doxygen 1.6.0   Back to index