Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Gender

    [|GetGender| returns 0 if the given animate object is female, and 1 if male,
    and is abstracted as a routine in case something more elaborate is ever
    needed.

    For GNAs -- gender/noun/animation combinations -- see the {\it Inform Designer's
    Manual}, 4th edition.]

    [ Unused. ]

    [ GetGender person;
    if (person hasnt female) rtrue;
    rfalse;
    ]

    To decide which number is the gender-animation of (noun - an object) (this is GetGNAOfObject):
        let the noun's gender be the default gender for inanimate things;
        if the noun provides the property neuter directly:
            let the noun's gender be neuter;
        otherwise if the noun provides the property female directly:
            let the noun's gender be female;
        otherwise if the noun provides the property linguistically male directly:
            let the noun's gender be linguistically male;
        otherwise if the noun provides the property animate directly:
            let the noun's gender be the default gender for animate things;
        let the g&a be 0;
        unless the noun provides the property animate directly, increase the g&a by 6;
        if the noun provides the property plural-named directly, increase the g&a by 3;
        if the noun's gender holds the property neuter, increase the g&a by 2;
        if the noun's gender holds the property female, increase the g&a by 1;
        decide on the g&a.

    [ The above returns a number from 0 to 11 :
    00 animate male
    01 animate female
    02 animate neuter
    03 animate male plural
    04 animate female plural
    05 animate neuter plural
    06 inanimate male
    07 inanimate female
    08 inanimate neuter
    09 inanimate male plural
    10 inanimate female plural
    11 inanimate neuter plural
    ]


    [ GetGNAOfObject obj case gender;
    if (obj hasnt animate) case = 6;
    if (obj has male) gender = male;
    if (obj has female) gender = female;
    if (obj has neuter) gender = neuter;
    if (gender == 0) {
    if (case == 0) gender = LanguageAnimateGender;
    else gender = LanguageInanimateGender;
    }
    if (gender == female) case = case + 1;
    if (gender == neuter) case = case + 2;
    if (obj has pluralname) case = case + 3;
    return case;
    ]