Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter - Descriptors

    [In grammatical terms, a descriptor appears at the front of an English noun
    phrase and clarifies the quantity or specific identity of what is referred
    to: for instance, {\it my} mirror, {\it the} dwarf, {\it that} woman.
    (Numbers, as in {\it four} duets, are also descriptors in linguistics:
    but the I6 parser doesn't handle them that way.)

    Slightly unfortunately, the bitmap constants used for descriptors in the
    I6 parser have names in the form |*_BIT|, coinciding with the names of
    style bits in the list-writer: but they never occur in the same context.

    The actual words used as descriptors are read from tables in the language
    definition. |ArticleDescriptors| uses this table to move current word
    marker past a run of one or more descriptors which refer to the definite
    or indefinite article.]

    To reset descriptor words (this is ResetDescriptors):
        now the indefinite article mode is false;
        exclude all possibilities from the type of descriptor word used;
        now the number of items wanted is 0;
        now probably plural is false;
        now what the pronoun stands for is nothing;
        now the grammatical case is all possible grammatical cases;
        we shouldn't assume leading words to be descriptors;
        now where we found a number used like an adjective is at the 0th position.

    [ ResetDescriptors;
    indef_mode = 0; indef_type = 0; indef_wanted = 0; indef_guess_p = 0;
    indef_possambig = false;
    indef_owner = nothing;
    indef_cases = $$111111111111;
    indef_nspec_at = 0;

    [ ArticleDescriptors o x flag cto type n;
    if (wn > num_words) return 0;

    for (flag=true : flag :) {
    o = NextWordStopped(); flag = false;

    for (x=1 : x<=LanguageDescriptors-->0 : x=x+4)
    if (o == LanguageDescriptors-->x) {
    type = LanguageDescriptors-->(x+2);
    if (type == DEFART_PK or INDEFART_PK) flag = true;
    return 0;