 # ----------------------------mod:EP4IR------------------------------#
 # MEERTENS/KOSTER Affix Grammar for Basic English  #
 # original version 1962, updated 1991/1992         #
 # ADAPTED BY Carole Tiberius                       #
 # ADAPTED TO IR APPLICATIONS 2000 by C.H.A. KOSTER #
 # ADAPTED BY Tjark Verhoeven 2001, 2002            #
 # Copyright University of Nijmegen.                #
 #                                                  #
 #            Version 2.3.2                           #
 #                                                  #

GRAMMAR npx.

|segment mode|

|invisible characters " :\t\n\r\'\`\"\(\)"|
|word terminators " \t\n+:,;.!?/%\$\'\`\""|

LEXICON adj, noun, adv, misc, verb 
DEFINES
  ADJE(GRAD,PREP),
  ADJE_TO(GRAD),
  ADVB,
  NOUN(NUMB),
  DIMENSION,
  VERBI(PREP,TRAN),
  VERBS(PREP,TRAN),
  VERBV(PREP,TRAN),
  VERBG(PREP,TRAN),
  VERBP(PREP,TRAN),
  VERBI(PREP,TRAN, PART),
  VERBS(PREP,TRAN, PART),
  VERBV(PREP,TRAN, PART),
  VERBG(PREP,TRAN, PART),
  VERBP(PREP,TRAN, PART),
  PARTICLE(PART),
  AUXV(NUMB,PERS),
  ART(NUMB),
  COPI,
  COPS,
  COPP,
  COPV,
  COPG,
  DET(NUMB),
  PREDET(NUMB),
  PREPOS(PREP),
  PREPOS,
  POSSPRON,
  GENPRON,
  PERSPRON(NUMB, PERS, CASE),
  REFLPRON(NUMB,PERS),
  RELPRON(CASE), QPRON(CASE),
  TOBE(NUMB, PERS),
  TOBE(TENS),
  TOHAVE(NUMB, PERS),
  TOHAVE(TENS),
  TNOUN,
  NOUNT(TRAD, NUMB),
  NOUNC(NUMB),
  MONTH,
  PNAME,
  NUM(TYPE),
  CON(LEVEL).

INCLUDES interface.

ROOT segment.

 segment:
    sentence;
    $PENALTY(15), NP / "[", NP, "]"!
    $SKIP(".*") / "SKIPPED: ", $SKIP.

 sentence:
    statement, [period] /
          statement;
    $PENALTY(20), question, ["?"] /
          question;
    $PENALTY(20), order, ["!"] /
          order.

 PRICE:
 		$PENALTY(2).

 #--------------------------mod:META SYNTAX-------------------------#

NUMB::sing | plur.

PERS::first | secnd | third.

CASE::nom | gen | dat | acc.

TRAN::intr | XTRAN.

XTRAN::trav | ditr.

PREP::none | XPREP.

XPREP::without | again | to | from | at | of | on | by | into |
  for | in | with | after | among | across | against | around |
  about | through | over | towards | onto | under | along |
  between | as | before | like | behind.

TENS::infi | prpl | papl.

GRAD::pred | to+verb | ATTR.

ATTR::abso | comp | supl.

TYPE::card | ord.

LEVEL:: coo| sub| loc.

PART::none | XPART.

XPART::about | abroad | across | ahead | along | apart | around |
    aside | away | back | behind | by | down | forth | forward | home |
    in | off | on | out | over | round | through | to | together |
    under | up.

TRAD::TEXT.

 #----------------------------mod:ORDER------------------------------#
 order:
    [neg], VOC phrase(sing, secnd) /
          "{P:you", VOC phrase, "}";
 # EX give him tomorrow what he wants now!
 # EX do not believe everything you hear
    [neg], LEX_TOBE(infi), predicate /
          "{P:you,", predicate, "}".
 # EX be prepared!

 neg:
	"do not";
	"don't".

#--------------------------mod:STATEMENT------------------------------#		
 #--------------------------SENTENCE PATTERNS-------------------#

 # codes of components:
 #   S  subject
 #   V  verb clause
 #   O  object
 #   C  complement or indirect object
 #   P  predicate
 #   nC no complement
 #   nO no object
 #   o  reduced object(e.g. in relative clauses)
 #   x  copula or 'to be' form
 #  x.v split verb clause, starting with copula or 'to be' form
 #  v.v split verb clause, starting with auxiliary verb
 #   p  participle
 #
 # subcategorization is described by the verb's <prep trans>
 # which guides the expression of complements in OC phrase.
 #   NONE INTR  intransitive   to sneeze
 #    FOR INTR                 to go for something
 #   NONE TRAV  transitive     to see it
 #     TO TRAV                 to throw it to someone
 #     TO DITR  ditransitive   to give someone it/
 #                             to give it to someone = <TO TRAV>

 #-----------------------STATEMENT----------------------------#

 statement:
    Wquoteopen, statement, Wquoteclose;
    simple statement,
       (coordinator, statement; ).
 # EX the spirit is willing but the flesh is weak.
 # EX Scrolling changes the display but does not move the insertion point

 simple statement:
    SVOC phrase /
          "{", SVOC phrase, "}";
    SxP phrase /
          "{", SxP phrase, "}".
 # EX this is the story of my life

 SVOC phrase:
 # including topicalizations
  opt circumstances, subject(NUMB, PERS), VOC phrase(NUMB, PERS)
             / subject, VOC phrase, opt circumstances;
 # EX last morning I could greet him in the garden
 # EX the vatican has spoken
 # EX IBM has been sponsoring a sequence of software engineering conferences
 # EX he is asking the president for clemency
  opt circumstances, subject(NUMB, PERS), VOC phrase(NUMB, PERS),
             coordinator, VOC phrase(NUMB, PERS) /
   subject, VOC phrase.1, opt circumstances, "}{",
   subject, VOC phrase.2, opt circumstances;
 # EX the apparatus includes a calculator and does not require a tachogenerator
  opt circumstances, subject(NUMB, PERS), VOC phrase(NUMB, PERS),
             subordinator, pOC phrase(prpl), $PENALTY /
    		     subject, VOC phrase, "}{",
                     subject, ",", pOC phrase;
 # EX I saw the boy while driving a horse
  opt circumstances, subject(NUMB, PERS), VOC phrase(NUMB, PERS),
         coordinator, copula(NUMB, PERS), participle(XTRAN, none, PREP, papl),
              pref PP(PREP), agent, opt circumstances /
         subject, VOC phrase, opt circumstances.1, "}{", agent, ",[", participle,
            ",", subject, pref PP, opt circumstances.1, opt circumstances.2, "]" ;
  PP(PREP), SVOnC phrase(PREP) /
          SVOnC phrase, PP, "]".
 # EX to this weakness he gave in easily
 # EX on those trivialities he wasted his whole life

 SxP phrase:
      # --- subject first (normal order)
  opt circumstances, subject(NUMB, PERS), xP phrase(NUMB, PERS), $PENALTY(2) /
     subject, xP phrase, opt circumstances;
 # EX unfortunately you're just too late to see him
 # EX I am rich enough
 # EX the spirit is willing
      # --- passive
  opt circumstances, subject(NUMB, PERS), copula(NUMB, PERS),
           participle(XTRAN, none, PREP, papl), pref PP(PREP), agent,
           opt circumstances /
              agent, ",[", participle, ",", subject, pref PP,
                 opt circumstances.1, opt circumstances.2, "]";
 # EX you will be thrown to the wolves by me personally
 # EX this conference seems to be sponsored by IBM
 # EX the president was fruitlessly asked for clemency
 # EX his pride was hurt
 # EX it was given to me by my father's hand
 # the following three generate the same sentences
  opt circumstances, subject(NUMB, PERS), copula(NUMB, PERS),
           participle(ditr, none, to, papl), pers pron(NUMB1, PERS1, dat),
           agent, opt circumstances /
              agent, ",[", participle, ",", subject, "|to ", pers pron,
                 opt circumstances.1, opt circumstances.2, "]";
 # EX it has been owed me by you
  opt circumstances, subject(NUMB, PERS), to be(NUMB, PERS),
       participle(ditr, none, to, papl), object, agent, opt circumstances /
     agent, ",[", participle, ",", object, "|to ", subject,
                 opt circumstances.1, opt circumstances.2, "]";
 # EX the preceding president was given a present by the presiding president
 # --- dative without preposition
  opt circumstances, pers pron(NUMB1, PERS1, dat), to be(NUMB, PERS),
       participle(ditr, none, PREP, papl), object, agent,
       opt circumstances /
          agent, ",[", participle, ",", object, "|to ", pers pron,
             opt circumstances.1, opt circumstances.2, "]";
 # EX you have been given by your superiors plenty of black marks
  opt circumstances, noun group(NUMB, PERS, dat), to be(NUMB, PERS),
       participle(ditr, none, to, papl), agent, object,
       opt circumstances /
          agent, ",[", participle, ",", object, "|to ", noun group,
             opt circumstances.1, opt circumstances.2, "]";
 # EX him have been given plenty of black marks by his superiors
 # --- genitive
  opt circumstances, gen pron, copula(NUMB, PERS), subject(NUMB, PERS) /
          subject, ",", gen pron;
 # EX mine is the vengeance
 # EX his was the best result
 # --- ditr passive
       PP(PREP), to be(NUMB, PERS), participle(ditr, none, PREP, papl),
           agent, subject(NUMB, PERS), opt circumstances /
              agent, ",[", participle, ",", subject, PP,
                 opt circumstances, "]";
 # EX to you has been given by him an enormous task
       PP(PREP), to be(NUMB, PERS), participle(ditr, none, PREP, papl),
        subject(NUMB, PERS), agent, opt circumstances /
              agent, ",[", participle, ",", subject, PP,
                 opt circumstances, "]".
 # EX to you has been given an enormous task by him

 #------------------------mod:RELATIVE CLAUSE-----------------------#
 # The relative clause follows the SVOC pattern, apart from the
 # fact that either the complement C or the object O is to be found
 # to the left of the phrase. Hence SVOnC and SVCnO.

 SVOnC phrase(PREP):
    subject(NUMB, PERS), verb group(TRAN, PART, PREP, NUMB, PERS),
       opt adverbs, OnC phrase(TRAN, PART) /
          subject, ",[", verb group, opt adverbs, OnC phrase.
 # EX it will be you to whom I return the book
 # EX it will be you to whom I give it back

 OnC phrase(intr,PART):
    particle(PART), opt circumstances.

 OnC phrase(XTRAN,PART):
    pref object, particle(PART), opt circumstances.

 SVCnO phrase:
    subject(NUMB, PERS), verb group(XTRAN, none, PREP, NUMB, PERS),
        pref PP(PREP), opt circumstances /
           subject, ",[", verb group, ",", pref PP, opt circumstances, "| ";
 # EX that's the book which I returned to you yesterday
        $PENALTY(2), subject(NUMB, PERS), copula(NUMB, PERS), predicate /
           "[[", subject, ",", predicate, "],";
 # EX that's the book which is the most beautiful in the world
        $PENALTY(2), subject(NUMB, PERS), copula(NUMB, PERS) /
              "[", subject ,",".
 # EX that's what it is

 # EX it is this man whose book I return to you
 # EX it is this man whose book it was yesterday

 rel phrase(NUMB,PERS,nom):
   # preposed subject
    [Wcomma], LEX_RELPRON(nom), xP phrase(NUMB, PERS) /
          xP phrase;
 # EX I will kill you who are my brother
    [Wcomma], LEX_RELPRON(nom), subject(NUMB2, PERS), copula(NUMB2, PERS) /
          ",", subject;
 # EX he was the child which he was  ####
 # EX you are not half the man that you used to be  ####
    [Wcomma], LEX_RELPRON(nom), VOC phrase(NUMB, PERS) /
          VOC phrase;
 # EX I hate the man who is looking at me
 # EX I will forgive those who have trespassed against me
    Wthat, SVOC phrase /
          "{", SVOC phrase, "}";
 # EX this happened during the period that I learned to drive
    $PENALTY(6), SVOC phrase /
          "{", SVOC phrase, "}".
 # EX this happened during the period I was sick


 rel phrase(gen):
    [Wcomma], LEX_RELPRON(gen), subject(NUMB, PERS), subject(NUMB1, PERS1),
       copula(NUMB, PERS) /
          subject.1, "{", subject.2, ",", subject.1, "}";
 # EX do you know the man whose brother I am
    [Wcomma], LEX_RELPRON(gen), subject(NUMB, PERS), SVCnO phrase /
          subject, "{", SVCnO phrase, subject, "]}";
 # EX do you know the man whose brother I see
    [Wcomma], LEX_RELPRON(gen), subject(NUMB, PERS), VOC phrase(NUMB, PERS) /
          "[", subject, VOC phrase, "]";
 # EX the owner whose cat died cried
    [Wcomma], LEX_RELPRON(gen), subject(NUMB, PERS), copula(NUMB, PERS),
       participle(XTRAN, none, PREP, papl), pref PP(PREP), agent,
           opt circumstances /
              subject, "{", agent, ",[", participle, ",", subject,
              pref PP, opt circumstances, "]}".
 # EX  the man whose shoes were polished left

 rel phrase(dat):
    preposition(PREP), LEX_RELPRON(dat), SVOnC phrase(PREP) /
          SVOnC phrase, "|", preposition;
 # EX this is the man for whom I am paying
    LEX_RELPRON(dat), SVOnC phrase(PREP), preposition(PREP) /
          SVOnC phrase, "|", preposition;
 # EX this is the person whom I am paying for
 # EX this is the plan that I agreed to
    SVOnC phrase(PREP), preposition(PREP) /
          SVOnC phrase, preposition .

 rel phrase(acc):
    [Wcomma], LEX_RELPRON(acc), SVCnO phrase /
          SVCnO phrase;
 # EX this is the man that I saw
    $PENALTY(6), LEX_PERSPRON(NUMB,PERS,nom),
        verb group(XTRAN, none, PREP, NUMB, PERS), pref PP(PREP),
             opt circumstances /
      LEX_PERSPRON, ",[", verb group, ",", pref PP, opt circumstances, "|".
 # EX the movie star was seen with the man she loved
 # EX this was the book I asked for


 extended rel phrase(NUMB,gen):
   noun kernel(NUMB), [Wcomma], LEX_RELPRON(gen),
    subject(NUMB2, PERS), SVCnO phrase /
       noun kernel, "[,[", SVCnO phrase, "[", subject, ",", noun kernel, "]]]]";
 # EX this is the man whose book I return to you
 # EX this is the man whose book it was yesterday
 # EX you know the man whose brother I am
 # EX you know the man whose brother I see
   noun kernel(NUMB), [Wcomma], LEX_RELPRON(gen),
    subject(NUMB2, PERS), VOC phrase(NUMB2, PERS) /
       "[", noun kernel, ",[", subject, VOC phrase, "]]";
 # EX the man whose shoes were polished left
 # EX the owner whose cat died of hunger cried with remorse
   noun kernel(NUMB), [Wcomma], LEX_RELPRON(gen),
    subject(NUMB2, PERS), copula(NUMB2, PERS),
       participle(XTRAN, none, PREP, papl), pref PP(PREP), agent,
           opt circumstances /
              noun kernel, "[,[", agent, ",[", participle,
              ",[", subject, ",", noun kernel, "]",
              pref PP, opt circumstances, "]]]".
 # EX  the man whose car was devastated by an earthquake was shocked


 # ---------------------------mod:QUESTION---------------------------#
 # in questions, either a single verbform of the verbal part precedes
 # the subject, allowing the patterns  xSpOC and  vSvOC
 # or a subject, object or complement is topicalized(without determiner)
 # with the patterns VOC, vSvCnO and vSvOnC.

 question:
    [localisator], vSvOC phrase /
          "{", vSvOC phrase, "}";
 # EX could you forgive me the errors of my ways?
 # EX when will you forgive me?
 # EX has IBM sponsored this conference
    [localisator], xSpOC phrase /
          "{", xSpOC phrase, "}";
 # EX am I going home in the morning?
 # EX why are you not more concerned about the consequences of your deeds?
    [localisator], adjective, LEX_TOBE(NUMB, PERS), subject(NUMB, PERS) /
          "{", subject, ",", adjective, "}";
 # EX how green is my valley?
 # EX how open to negotiation is your offer?
 # -----
    LEX_QPRON(nom), opt subject(NUMB),
       xP phrase(NUMB, PERS) /
              "{", opt subject, xP phrase, "}";
 # EX who are you
 # EX who is that tall dark stranger in my bedroom?
 # EX which country was the site of your birth?
 # EX which end is up?
 # EX which son are you?
 # EX which of you is the guilty one?
    LEX_QPRON(nom), opt subject(NUMB),
        VOC phrase(NUMB, PERS) /
              "{", opt subject, VOC phrase, "}";
 # EX who killed Cock Robbin?
 # EX which unfortunate stranger has fallen into your clutches?
 # EX which bastard has stolen my car?
 # -----
    LEX_QPRON(gen), opt subject(NUMB), xP phrase(NUMB, PERS), opt preposition(PREP) /
          "{", opt preposition, opt subject, xP phrase, "}";
 # EX whose idea was this?
 # EX whose house are you in?
 # EX whose children are you?
    LEX_QPRON(gen), opt subject(NUMB), VOC phrase(NUMB, PERS) /
          "{", opt subject, VOC phrase, "}";
 # EX whose cat has eaten all the mice?
    LEX_QPRON(gen), pref object, vSv part(TRAN, none, PREP),
      CnO phrase(PREP) /
          "{", vSv part, pref object, CnO phrase, "]}";
 # EX whose cat have you held over a barrel?
 # -----
    LEX_QPRON(dat), opt complement, to be(NUMB, PERS), predicate,
       preposition(PREP) /
          "{", predicate, ",", preposition, opt complement, "}";
 # EX what city are we in?
 # EX what is it for?
    LEX_QPRON(dat), opt complement, vSv part(TRAN, PART, PREP),
       OnC phrase(TRAN, PART), preposition(PREP) /
          "{", vSv part, OnC phrase, "|", preposition, opt complement,
             "]}";
 # EX what do you believe in
 # EX what were they looking for
 # EX whom do you give it back to
    preposition(PREP), LEX_QPRON(dat), opt complement, vSv part(TRAN,
       PART, PREP), OnC phrase(TRAN, PART) /
          "{", vSv part, OnC phrase, "|", preposition, opt complement,
             "]}";
 # EX in what state did he arrive
 # EX to which side have you given your vote?
 # EX to whom did you give it back?
    $PENALTY(2), LEX_QPRON(dat), opt complement, vSv part(ditr, none, PREP),
       OnC phrase(ditr, none) /
          "{", vSv part, OnC phrase, "|to ", opt complement, "]}";
 # EX which side have you given your vote?
 # -----
    LEX_QPRON(acc), pref object,
       vSv part(trav, none, PREP),
           CnO phrase(PREP) /
              "{", vSv part, pref object, CnO phrase, "]}";
 # EX which cat have you held over a barrel in the garden
 # EX what have we learned today?
    LEX_QPRON(acc), pref object,
        vSv part(ditr, none, PREP),
           pref indirect object(PREP), opt circumstances /
              "{", vSv part, pref object, pref indirect object,
                 opt circumstances, "]}";
 # EX what do I give to you?
 # EX what do I give you
    LEX_QPRON(acc), pref object,
        to be(NUMB, PERS), subject(NUMB, PERS),
           participle(trav, none, PREP, prpl), CnO phrase(PREP) /
              "{", subject, ",[", participle, ",", pref object, CnO phrase,
                 "]}".
 # EX which egg are you eating for breakfast
 # EX what are you giving her for christmas?
 # EX whom do you want to eat for breakfast?

 OPTION opt subject(NUMB):
    noun group(NUMB, PERS, nom), [Wcomma] /
          noun group;
    $PENALTY /
          "P:it".

 OPTION opt complement:
    noun group(NUMB, PERS, dat);
    $PENALTY /
          "P:it".

 xSpOC phrase:
    # active
    $PENALTY(2), LEX_TOBE(NUMB, PERS), subject(NUMB, PERS), predicate /
          subject, ",", predicate;
 # EX am I stupid
    $PENALTY(2), LEX_TOBE(NUMB, PERS), subject(NUMB, PERS), opt adverbs /
          subject, opt adverbs;
 # EX am I
    $PENALTY(2), LEX_TOHAVE(NUMB, PERS), subject(NUMB, PERS), opt adverbs, LEX_TOBE(papl),
       predicate /
          subject, ",", predicate, opt adverbs;
 # EX have I been stupid again
     LEX_TOBE(NUMB, PERS), subject(NUMB, PERS), opt adverbs,
          pOC phrase(prpl) /
          subject, pOC phrase ;
 # EX am I returning the lost book to its rightful owner
 # EX am I giving it back to you
    LEX_TOHAVE(NUMB, PERS), subject(NUMB, PERS), opt adverbs, LEX_TOBE(papl),
          pOC phrase(prpl) /
          subject, pOC phrase ;
 # EX has IBM been sponsoring this conference
    # passive
    LEX_TOBE(NUMB, PERS), subject(NUMB, PERS), opt adverbs, participle(XTRAN,
       none, PREP, papl), pref PP(PREP), agent, opt circumstances /
          agent, ",[", participle, ",", subject, pref PP, opt circumstances, opt adverbs, "]";
 # EX is this sacrifice demanded from him
 # EX is this conference sponsored by IBM
    LEX_TOHAVE(NUMB, PERS), subject(NUMB, PERS), opt adverbs,
     LEX_TOBE(papl), participle(XTRAN, none, PREP, papl),
       pref PP(PREP), agent, opt circumstances /
          agent, ",[", participle, ",", subject, pref PP,
             opt circumstances, opt adverbs, "]".
 # EX has this conference been sponsored by IBM

 # EX this conference is sponsored by IBM
 # EX this conference is sponsored, by the way.

 # EX the capital of Honduras was basking in the sun
 # EX he has given us so much
 # EX the end of the world was regularly prophesied to us
 # EX the solution to his problems was given to him

 vSvOC phrase:
    vSv part(TRAN, PART, PREP), OC phrase(TRAN, PART, PREP) /
          vSv part, OC phrase, "]".
 # EX can I live with myself
 # EX what do I give to you

 vSv part(TRAN,PART,PREP):
    LEX_AUXV(NUMB, PERS), subject(NUMB, PERS),
        infinitive(TRAN,PART,PREP) /
          subject, ",[", infinitive, ",";
 # EX what do I owe
    LEX_TOHAVE(NUMB, PERS), subject(NUMB, PERS),
        participle(TRAN, PART, PREP, papl) /
          subject, ",[", participle, ",".
 # EX what am I preparing
 # EX what have I done

 CnO phrase(PREP):
    pref PP(PREP), opt circumstances.

#--------------------------mod:NOUN PHRASE-------------------------#

 NP,NP(CASE),NP(NUMB,PERS,CASE):
    noun phrase(NUMB, PERS, CASE);
    $PENALTY(1), verbal noun phrase(NUMB,PERS,CASE).

 verbal noun phrase(sing,third,nom|dat|acc):
    RELPRON(acc), SVCnO phrase /
          "P:it {", SVCnO phrase, "]}";
 # EX what you give to others is given to you
    RELPRON(nom), VOC phrase(NUMB,PERS) /
          "[P:it", VOC phrase, "]";
 # EX what causes the problem is clear
    Wthat, SVOC phrase /
          "P:it {", SVOC phrase, "}";
 # EX that you have come is good
 # EX I am not so sure that you are the winner
    opt adverbs,
       Wto, inf phrase/ inf phrase.
 # EX just to be here is bliss
 # EX to know you is to love you

 verbal noun phrase(sing,third,nom|dat|acc):
    opt adverbs, pOC phrase(prpl) /
       pOC phrase.
 # EX not reading the manual is stupid
 # EX I am accustomed to reading everything

 noun phrase(NUMB,PERS,CASE):
    noun part(NUMB, PERS, CASE);
    $PENALTY(2), adverb, noun phrase(NUMB, PERS, CASE) / noun phrase;
 # EX only you and the dog can make me happy
    noun part(NUMB, PERS, CASE), Wnor, noun phrase(NUMB, PERS1, CASE) /
          "[", noun part, "| ", noun phrase, "]";
 # EX neither man nor beast can know the will of God
    noun part(sing, PERS2, CASE2), Waccent s, noun group(NUMB, PERS, CASE) /
              "[", noun group, ",of ", noun part, "]".
 # EX all he does is following nature's call

 noun phrase(plur,PERS,CASE):
    noun part(NUMB, PERS, CASE), coordinator, noun phrase(NUMB1, PERS1, CASE) /
          "[", noun part, "| ", noun phrase, "]".
 # EX The good, the bad and the ugly gave a new twist to the genre
 # EX the ant and the grasshopper lived happily ever after

 noun part(NUMB,PERS,CASE):
    [LEX_PREDET(NUMB)], [Wof], article(NUMB), noun group(NUMB, PERS, CASE) /
          noun group;
 # EX most gnus are good gnus
    poss pron, noun part(NUMB, PERS, CASE) /
          "[", noun part, ",", poss pron, "]";
 # EX my home is my castle
    $PENALTY(1), noun group(NUMB, PERS, CASE),
        [LEX_REFLPRON(NUMB,PERS)]; # prefer a determiner
 # EX he himself is not to blame
    LEX_DET(NUMB), [Wof], noun part(NUMB, PERS, CASE) /
          noun part;
    quantity, noun part(NUMB,PERS,CASE) /
          "[", noun part, ",", quantity, "]".
 # EX 1 kilo of pure gold is worth a fortune
 # EX I saw twelve of them in the garden
 # EX forty robbers were sitting at the campfire

 quantity:
   number, opt dimension, opt unitshift, [Wof] /
     "Q:", number, opt dimension, opt unitshift.
 # EX the concentration was assayed at 300 mumol / l acetaldehyde

 opt dimension: dimension; .
 opt unitshift: unitshift; .

 unitshift:
   "/", noun kernel(sing) /
	     "|per ", noun kernel;
   "per", noun kernel(sing) /
	     "|per ", noun kernel.
 # EX The standard dose is 12 mg Aspirine per kilogram

 noun part(NUMB,PERS,CASE):
    $PENALTY, noun group(NUMB, PERS, CASE), pOC phrase(prpl) /
          "[", noun group, ",", pOC phrase, "]".
 # EX I see a lion flying through the air
 # EX I dreamt that I saw you lying in a pool of blood
 # EX we discovered a paradise forgotten by time   ##xP??

 noun part(NUMB,PERS,CASE):
    noun group(NUMB, PERS, CASE), rel phrase(NUMB, PERS, nom) /
          "[", noun group, rel phrase, "]";
    noun group(NUMB, PERS, CASE), rel phrase(gen) /
          noun group, "{", rel phrase, noun group, "}";
    extended rel phrase(NUMB, gen) ;  ####
    noun group(NUMB, PERS, CASE), rel phrase(dat | acc) /
          noun group, "{", rel phrase, noun group, "]}".

 noun group(NUMB,PERS,CASE):
   adjective, noun group(NUMB,PERS,CASE) /
          "[", noun group, ",", adjective, "]";
 # EX it seems better to let sleeping dogs lie
   participle(trav, none, none, papl), noun group(NUMB,PERS,CASE) /
          noun group, "{P:it ,[", participle, ",", noun group, "]}";
 # EX that is merely acquired behaviour
    pers pron(NUMB, PERS, CASE).

 noun group(NUMB,third,CASE):
    noun kernel(NUMB);
    noun kernel(NUMB), postmodifiers /
          "[", noun kernel, ",", postmodifiers, "]".
 # EX this force causes spindle 1 to move over axis 2
 # EX we grew up in a little house in a dark wood

 noun kernel(NUMB):
    LEX_NOUN(NUMB), [LEX_REFLPRON(NUMB,third)] /
          LEX_NOUN;
 # EX the pupil himself made not a single error
    $PENALTY, LEX_NOUN(sing), noun kernel (NUMB) /
          "[", noun kernel, ",", LEX_NOUN, "]";
 # EX air pollution is pollution of the air
    PRICE, PRICE, quantity /
          "N:", quantity;
 # EX the concentration was assayed at 300 mumol / l ####
    PRICE, PRICE, PRICE, adjective /
          "N:", adjective.
 # EX the bold and the beautiful can do as they like

 postmodifiers:
   postmodifier, rest postmodifiers.
	
 rest postmodifiers:
   postmodifiers /
          "|" , postmodifiers; .
	
 postmodifier:
    PP(of);
 # EX I expect some pollution of the water by effluents
    $PENALTY, PP;
 # EX I've always wanted to meet the man on the moon
 # EX he was hurt in a fall off the cliff
 # EX iron supplementation during pregnancy is important
    purpose;
 # he used soap to clean the diskette
    parenthesis;
 # EX Dennis, the well-known menace, is a cartoon strip figure
    $PENALTY(2), [Wcomma], adjective clause;
 # EX he gave signals based on the morse code consisting of dots and stripes
    $PENALTY(2), ["No."], numeral / "A:Q:", numeral.
 # EX the overall configuration is shown in figure 7
 # EX case a1 is to be treated in more detail

 parenthesis:
   Wcomma, noun phrase(NUMB, PERS, CASE), Wcomma /
         "[", noun phrase, "]";
 # EX Rhone Poulenc, the French chemical enterprise, was the coordinator.
    Wcomma, pred adjectives, Wcomma /
          "{ ", pred adjectives, "}";
 # EX sand, mixed with wet clay, is an excellent building material.
			opener, noun phrase(NUMB2, PERS, CASE), [adverb], closer /
          "{ ", noun phrase, "}".
 # EX the whole family ( man, wife and children ) was killed

 period: ".".

 opener:
    "(-";
		"(".

 closer:
    ")-";
		")".

 PP:
    $PENALTY(3), opt adverbs, LEX_PREPOS, NP(dat) /
          opt adverbs, "|", LEX_PREPOS, NP;
    PP(PREP).

 PP(XPREP):
 # extra penalty so that the `between' and `from' constructions below
 # have some advantage
    opt adverbs, LEX_PREPOS(XPREP), NP(dat) /
          opt adverbs, "|", LEX_PREPOS, NP.
					
 PP(between):
    $PENALTY(-2), opt adverbs, LEX_PREPOS(between), noun phrase(NUMB, PERS, dat),
     Wand, noun phrase(NUMB, PERS, dat) /
        opt adverbs, "|", LEX_PREPOS,"[", noun phrase.1,"| ",noun phrase.2,"]".
 # EX he is caught between the devil and the deep blue sea.

 PP(from):
    $PENALTY(-2), opt adverbs, LEX_PREPOS(from), noun phrase(NUMB, PERS, dat),
       LEX_PREPOS(to), noun phrase(NUMB, PERS, dat) /
          opt adverbs, "|", LEX_PREPOS.1, noun phrase.1, "|",
             LEX_PREPOS.2, noun phrase.2.
 # EX the situation is going from bad to worse.

 pref PP(none): .

 pref PP(XPREP):
    PP(XPREP);
    $PENALTY(2).

 #-------------------mod:COMPLEMENTS-----------------------------#

 subject(NUMB,PERS):
    NP(NUMB, PERS, nom), [Wcomma] /
          NP.

 subject(sing,third):
    $PENALTY(3), "there" /
      "P:it".

 pref object:
    object;
    $PENALTY(3).

 object:
       NP(NUMB, PERS, acc);
 # EX he should blame himself for this
       noun phrase(NUMB, PERS, acc), Wto, infinitive(trav, none, PREP),
         C phrase(PREP) /
          "[", noun phrase, ",[", infinitive, ",", C phrase, "]";
 # EX he has nothing to do with this
 # EX he has only himself to thank for this
       noun phrase(NUMB, PERS, acc), Wto, inf phrase /
          "[", noun phrase, ",", inf phrase, "]";
 # EX this remark caused his grey cells to do overwork
       noun phrase(NUMB, PERS, acc), Wto, infinitive(TRAN, PART, PREP),
           OC phrase(TRAN, PART, none), preposition(PREP), opt circumstances /
           noun phrase, "]|[", infinitive, ",", OC phrase,
             "|", preposition, noun phrase;
 # EX he has nothing to live for
 # EX he has no spoon to eat his soup with
       PRICE, noun phrase(NUMB, PERS, acc), resultative part /
          "[", noun phrase, ",", resultative part, "]".
 # EX it made his nose turn red


 resultative part:
    $PENALTY(2), inf phrase.
 # EX it made his nose turn red
 # EX I let him back away
 # EX I let him back away the car


 pref indirect object(XPREP):
    indirect object(XPREP);
    $PENALTY(2).

 indirect object(to):
    PP(to) /
          PP;
    $PENALTY(2), NP(dat) /
          "|to ", NP.

 agent:
    "by", noun phrase(NUMB, PERS, dat) /
          noun phrase;
    $PENALTY(1) /
          "P:it".

 predicate:
    pred adjectives, opt circumstances;
 # EX most of your friends appear to be very stupid
    noun phrase(NUMB, PERS, nom|acc);
 # EX I am your friend , I kill you for nothing
    gen pron;
 # EX is this overcoat yours
    PRICE, circumstance.
 # EX she was always in the kitchen

 # EX the children of darkness are usually getting all the fun

 #--------------------------mod:VERB PHRASE-------------------------#

 VOC phrase(NUMB,PERS):
    verb group(TRAN, PART, PREP, NUMB, PERS), OC phrase(TRAN, PART, PREP) /
          ",[", verb group, ",", OC phrase, "]".
 # EX you meet your maker
 # EX do you like sandwiches for breakfast
 # EX he brought this out in the conversation

 xP phrase(NUMB,PERS):
    copula(NUMB, PERS), predicate /
          ",", predicate.
 # EX she became red in the face
 # EX he had been on a pelgrimage to Santiago

 pOC phrase(prpl):
    participle(TRAN, PART, PREP, prpl),
       OC phrase(TRAN, PART, PREP) /
            "[", participle, ",", OC phrase, "]".

OPTION OC phrase(TRAN, PART, PREP).

 OC phrase(intr,none,PREP):
    C phrase(PREP).
 # EX he went back to his house by the shortest route

 C phrase(XPREP):
    instrument, C phrase(XPREP);
 # EX he conceded with grace to my demands
    PP(XPREP), [instrument], opt circumstances;
 # EX she agreed to his wishes in all respects
    $PENALTY(2), [instrument], opt circumstances.
 # EX she agreed instantly

 C phrase(none):
    [instrument], opt circumstances.
 # EX it works

 OC phrase(trav,PART,PREP):
    object, particle(PART), C phrase(PREP) /
		         object, C phrase.
 # EX I promise to return the bottle to you as soon as possible
 # EX I promise to give the bottle back to you as soon as possible

 OC phrase(trav,PART,PREP):
    PRICE, particle(PART), C phrase(PREP).
 # promotion rule

 OC phrase(ditr,none,XPREP):
    pref indirect object(XPREP), opt adverbs, object, opt circumstances /
          object, pref indirect object, opt circumstances, opt adverbs;
 # EX I owe to you all I have in my life
 # EX I owe you all I have in my life
    object, opt adverbs, PP(PREP), opt circumstances /
          object, PP, opt circumstances, opt adverbs.
 # EX he owes his success to remorseless hard work

 OC phrase(ditr,none,none):
    object, predicate, opt circumstances /
     "[", object, ",", predicate, "]".
 # EX this made his nose their target
 # EX we called him Joe

 OC phrase(intr|trav,none,PREP):
 # to catch lacking ditr's
    PRICE, object, predicate, opt circumstances /
     "[", object, ",", predicate, "]".
 # EX it turned his nose red

 OPTION opt preposition(PREP):
    preposition(PREP);
    $PENALTY, LEX_PREPOS;
    .

 instrument:
    PP(with).
 # penalty because it is a kind of promotion?


 inf phrase:
   infinitive(TRAN, PART, PREP), OC phrase(TRAN, PART,PREP) /
     "[", infinitive, ",", OC phrase, "]".

#------------------------------VERB PART-----------------------#

 verb group(TRAN,PART,PREP,NUMB,PERS):
    verb form(TRAN, PART, PREP, NUMB, PERS);
 # EX father knows best
 # EX its surface felt rough to the touch
    [Wcomma], adverb, [Wcomma],
       verb group(TRAN, PART, PREP, NUMB, PERS) /
          verb group ;
 # EX he sometimes sees hallucinations
 # EX he always knows
    copula(NUMB, PERS), Wto, infinitive(TRAN, PART, PREP) /
          infinitive;
 # EX he seems to know
 # EX he is to be spared
    LEX_AUXV(NUMB, PERS), infinitive(TRAN, PART, PREP) /
          infinitive;
 # EX he may not know
    to have(NUMB, PERS), participle(TRAN, PART, PREP, papl) /
          participle;
 # EX he has known
    LEX_TOBE(NUMB, PERS), opt adverbs, participle(TRAN, PART, PREP, prpl) /
          participle, opt adverbs;
 # EX he is going
    to have(NUMB, PERS), opt adverbs, LEX_TOBE(papl), participle(TRAN, PART, PREP, prpl) /
          participle, opt adverbs.
 # EX he has been going

 #--------------------------mod:ADJECTIVE PHRASE--------------------#

 pred adjectives:
    pred adjective;
    [LEX_DET(NUMB)], pred adjective, coordinator, pred adjectives /
          pred adjective, "|", pred adjectives.
 # EX his hide was red, green and blue

 adjective:
    adverb, adjective /
          adjective;
 # EX the teeth of my dog are always sharper
    LEX_ADJE(ATTR,none);
 # EX the well-known wellknown man is well known
    $PENALTY, LEX_NOUN(NUMB), LEX_ADJE(abso, to) /
          "[", LEX_ADJE, ",|to ", LEX_NOUN, "]";
 # EX its fully abrasion resistant skin was visible
    PRICE, participle(TRAN, none, none, prpl) /
          "A:", participle.
 # EX do not attempt to break the seventh seal
 # EX that was my never-do-well nephew


 pred adjective:
    adjective;
 # EX it was already too late
    adjective clause.

 adjective clause:
    adverb, adjective clause /
      adjective clause;
 # EX I am always open to negotiation
    LEX_ADJE(GRAD, XPREP), PP(XPREP) /
          "[", LEX_ADJE, ",", PP, "]";
 # EX his writings are reminiscent of James Joyce
 # EX he ran so fast that he caught up with his own tail
    LEX_ADJE(abso,none), Wto, inf phrase /
          LEX_ADJE, "|", inf phrase;
 # EX it was too late to flee from the seething flames
    Wmore, LEX_ADJE(abso,none), Wthan, NP(CASE) /
          LEX_ADJE, "{", NP, ", ", LEX_ADJE, "}";
 # EX your friendship is more enduring than the love of a woman
    LEX_ADJE(comp,none), Wthan, NP(CASE) /
          LEX_ADJE, "{", NP, ", ", LEX_ADJE, "}";
 # EX his smile was somewhat larger than life
    LEX_ADJE(comp,none), Wthan, SVOnC phrase(none) /
          LEX_ADJE, "{", SVOnC phrase, "]}";
 # EX I can jump higher than Jack can throw a stone
    LEX_ADJE(supl,none), PP(of) /
          "[", LEX_ADJE, ", ", PP, "]";
 # EX he was the worst of the lot
    PRICE, participle(trav, none, PREP, papl), PP(PREP) /
          participle;
 # EX my daughter was all dressed up for the dance
    LEX_ADJE_TO(ATTR), Wto, inf phrase /
          LEX_ADJE_TO, "|", inf phrase ;
 # EX he was quick to understand the details
 # EX he was quick to explode
    LEX_ADJE(abso,none), PP(as) /
          "[", LEX_ADJE, ",", PP, "]".
 # EX he shall be washed as white as snow


 #-------------------------mod:SMALLFRY------------------------------#
 #-------------------------TIME---------------------------------#

OPTION opt circumstances:
    $PENALTY, [Wcomma], circumstance, [Wcomma],
     opt circumstances /
          circumstance, opt circumstances;
		.

 circumstance:
   subordinator, simple statement;
 # EX although the flesh is willing, the spirit is weak.
   localisator, simple statement;
 # EX whenever I see you my heart jumps up
    time phrase /
         "|X:", time phrase;
 # EX I saw him next morning
    [Wcomma], adverb, [Wcomma] /!
    $PENALTY, PP;
    purpose .
 # EX we serve to protect

 time phrase:
    time.
    #, [time phrase].

 time:
    "from", date, Wto, date;
    "between", date, Wand, date;
    date;
	time NP.

 time NP:
     [LEX_DET(NUMB)], TNOUN;
     [LEX_DET(NUMB)], MONTH;
     [LEX_DET(NUMB)], ADJE(GRAD,none), time NP.
 # it happened last friday
    		
 date:
    ["the"], LEX_NUM(ord), [Wof], date;
		["the"], LEX_NUM(ord), "instant";
    MONTH, dnumber,
           ([Wcomma], year;
            );
     [LEX_NUM(card)], MONTH,
           ([Wcomma], year;
           );
     year, [Wcomma, MONTH, dnumber].

 dnumber:
    $SKIP("[0-9]");
    $SKIP("1[0-9]");
    $SKIP("2[0-9]");
    $SKIP("3[0-1]").

 year:
    $SKIP("1[0-9][0-9][0-9]");
    $SKIP("20[0-9][0-9]");
    $SKIP("'[0-9][0-9]").

 #-------------------------MISC---------------------------------#

 purpose:
   ["in order"], Wto, LEX_TOBE(infi), predicate /
          "|", predicate;
 # EX this is too good to be true
   ["in order"], Wto, inf phrase /
          "|", inf phrase.
 # EX to see it you must climb on the roof
 # EX I climbed on the roof in order to see better
 # EX it takes a thief to catch a thief

 #--------------------------MORPHOLOGY--------------------------#
 # or, rather, interface to the lexicon #


 OPTION opt adverbs:
    [Wcomma], adverb, [Wcomma], opt adverbs /
      "| ", adverb, opt adverbs;
    .

 adverb:
    LEX_ADVB;
    $PENALTY, LEX_ADVB, coordinator, adverb /
       LEX_ADVB, "|", adverb.
					
 preposition(PREP):
    LEX_PREPOS(PREP).

 article(NUMB):
    LEX_ART(NUMB).

 particle(none):
		.

 particle(XPART):
    LEX_PARTICLE(XPART)/.

 pers pron(NUMB,PERS,CASE):
    LEX_PERSPRON(NUMB, PERS, CASE) /
          "P:", LEX_PERSPRON.

 poss pron:
    LEX_POSSPRON /
          "P:", LEX_POSSPRON.

 gen pron:
    LEX_GENPRON /
		      "P:", LEX_GENPRON.

RULE verb form(TRAN, PART, PREP, NUMB, PERS).

verb form(TRAN,none,PREP,sing,first):
    LEX_VERBI(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBI(PREP, TRAN).

verb form(TRAN,none,PREP,NUMB,secnd):
    LEX_VERBI(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBI(PREP, TRAN).

verb form(TRAN,none,PREP,sing,third):
    LEX_VERBS(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBS(PREP, TRAN).

# first | third
verb form(TRAN,none,PREP,plur,first | third):
    LEX_VERBI(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBI(PREP, TRAN).

verb form(TRAN,none,PREP,NUMB,PERS):
    LEX_VERBV(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBV(PREP, TRAN).

verb form(TRAN,none,PREP,infi):
    LEX_VERBI(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBI(PREP, TRAN).

verb form(TRAN,none,PREP,prpl):
    LEX_VERBG(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBG(PREP, TRAN).

verb form(TRAN,none,PREP,papl):
    LEX_VERBP(PREP, TRAN, XPART), particle(XPART);
    $PENALTY, LEX_VERBP(PREP, TRAN).

verb form(TRAN,XPART,PREP,sing,first):
    LEX_VERBI(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,NUMB,secnd):
    LEX_VERBI(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,sing,third):
    LEX_VERBS(PREP, TRAN, XPART).

# first | third
verb form(TRAN,XPART,PREP,plur,first | third):
    LEX_VERBI(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,NUMB,PERS):
    LEX_VERBV(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,infi):
    LEX_VERBI(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,prpl):
    LEX_VERBG(PREP, TRAN, XPART).

verb form(TRAN,XPART,PREP,papl):
    LEX_VERBP(PREP, TRAN, XPART).
					
copula(NUMB, PERS):  ##############
    to be(NUMB, PERS) ;
    other copula(NUMB, PERS), [Wto, LEX_TOBE(infi)] /
					"V:", other copula.

other copula(NUMB,PERS):
    LEX_COPV;
    LEX_AUXV(NUMB, PERS), opt adverbs, LEX_COPI;
    LEX_TOHAVE(NUMB, PERS), opt adverbs, LEX_COPP;
    LEX_TOBE(NUMB, PERS), opt adverbs, LEX_COPG;
    LEX_TOHAVE(NUMB, PERS), opt adverbs, LEX_TOBE(papl), LEX_COPG;
    LEX_TOHAVE(NUMB, PERS), LEX_COPP.

other copula(sing,first):
    LEX_COPI.

other copula(NUMB,secnd):
    LEX_COPI.

other copula(sing,third):
    LEX_COPS.

other copula(plur,first | third):
    LEX_COPI.

copula(infi):
    LEX_COPI.

infinitive(TRAN,PART,PREP):
    [Wcomma], adverb, [Wcomma], infinitive(TRAN, PART, PREP) /
          infinitive;
    verb form(TRAN, PART, PREP, infi);
    copula(infi), Wto, infinitive(TRAN, PART, PREP) /
          infinitive;
    LEX_TOBE(infi), participle(TRAN, PART, PREP, prpl) /
          participle;
    LEX_TOHAVE(infi), participle(TRAN, PART, PREP, papl) /
          participle;
    LEX_TOHAVE(infi), LEX_TOBE(papl),
       participle(TRAN, PART, PREP, prpl) /
          participle.

participle(TRAN,PART,PREP,TENS):
    [Wcomma], adverb, [Wcomma], participle(TRAN, PART, PREP, TENS)/
          participle;
    verb form(TRAN, PART, PREP, TENS).

participle(TRAN,PART,PREP,prpl):
    LEX_TOHAVE(prpl), verb form(TRAN, PART, PREP, papl) /
          verb form.
 # EX once having achieved his goal he returned to mediocrity

to be(NUMB,PERS):
    opt adverbs, LEX_TOBE(NUMB, PERS) / ;
 # EX I often am stupid
    to have(NUMB, PERS), opt adverbs, LEX_TOBE(papl) / ;
 # EX he has always been prudent
    LEX_TOBE(NUMB, PERS), opt adverbs, LEX_TOBE(prpl) / ;
 # EX he is being prudent
   other copula(NUMB, PERS), opt adverbs, Wto, LEX_TOBE(infi) / ;
 # EX you seem to be prudent
    LEX_AUXV(NUMB, PERS), opt adverbs, [copula(infi), Wto],
      LEX_TOBE(infi) / ;
 # EX you did not like to be prudent
    LEX_AUXV(NUMB, PERS), opt adverbs, [copula(infi), Wto],
      LEX_TOHAVE(infi), LEX_TOBE(papl) / ;
 # EX he does not appear to have been prudent enough
    LEX_TOBE(NUMB, PERS), opt adverbs, Wto, LEX_TOBE(infi) / .

to have(NUMB,PERS):
    LEX_TOHAVE(NUMB, PERS) / ;
    other copula(NUMB, PERS), opt adverbs, Wto, LEX_TOHAVE(infi) / ;
 # EX I seem to have been optimistic
    LEX_AUXV(NUMB, PERS), opt adverbs,
       [copula(infi), Wto], LEX_TOHAVE(infi) / .

coordinator:
    [Wcomma], LEX_CON(coo) /
          .

localisator:
    [Wcomma], LEX_CON(loc) /
          .

subordinator:
    [Wcomma], LEX_CON(sub) /
          .

 # MISC EXAMPLES
 # EX what were you trying to achieve
 # EX I talk the talk and I walk the walk
 # EX the winter storms were worst

 # EX the bread to be sliced smelled great
 # EX he was living in comfort, while they were dying of misery
 # EX the doctor came in, stinking of gin, and proceeded to lie on the table
 # EX analytical, simulation and statistical tools are employed
 # EX just take care of the pence and the pounds take care of themselves
 # EX it loomed large in his mind.
