Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - NounWord

    [|NounWord| (which takes no arguments) returns:
    (a) 0 if the next word is not in the dictionary or is but does not carry the
    ``noun'' bit in its dictionary entry,
    (b) 1 if it is a word meaning ``me'',
    (c) the index in the pronoun table (plus 2) of the value field of a pronoun,
    if it is a pronoun,
    (d) the address in the dictionary if it is a recognised noun.]

    To decide what understood word is the Nth pronoun: (- ct_1+2 -). [hackish]


    To decide what understood word is the possibility that it's a noun (this is NounWord):
        let the word be the next word;
        if the word is a word unknown by the game:
            decide on a word unknown by the game;
        if the word is 'ME':
            decide on ME The Player;
        if the word is listed as one of the pronouns in the language's pronoun list:
            decide on the Nth pronoun;
        if the usage of the word does not include being a noun:
            decide on a word unknown by the game;
        decide on the word.

    [ NounWord i j s;
    i = NextWord();
    if (i == 0) rfalse;
    if (i == ME1__WD or ME2__WD or ME3__WD) return 1;
    s = LanguagePronouns-->0;
    for (j=1 : j<=s : j=j+3)
    if (i == LanguagePronouns-->j)
    return j+2;
    if ((i->#dict_par1)&128 == 0) rfalse;
    return i;
    ]