Lab7 Writeup Before starting on this week's assignment, I worked on fixing whatever I broke while mucking with the lexical rules, which wasn't wroking when I handed in my last assignment (lab6). I fixed the adjectives and now the following examples, which were not parsing correctly last week parse as they should: The adjective must agree with the noun it modifies in terms of PNG as well as DEF: ani qra:PAAL.PRES-t at h-spr-im h-myniin-im I read:PAAL.PRES.SG.F ACC the-book.PL.M the-intersting.PL.M * ani qra:PAAL.PRES-t at h-spr-im myniin-im I read:PAAL.PRES.SG.F ACC the-book.PL.M intersting.PL.M The demonstratives were not working at all because the modorder feature was out of order (the lexical rules were not passing it up). ani qra:PAAL.PRES-t at h-spr h-zh I read:PAAL.PRES.SG.F ACC the-book.SG.M this.SG.M ani qra:PAAL.PRES-t at h-spr-im h-myniin-im h-alh I read:PAAL.PRES.SG.F ACC the-book.PL.M the-interesting-PL.M the-these.PL.M This was getting two parses. I can't remember exactly why (the rule marking adjectives as indefinte was firing before AND after the lexical rules, I think) but it's been fixed. ani qra:PAAL.PRES-t spr myniin ani qra:PAAL.PRES-t spr myniin:ADJ I read:PAAL.PRES.SG.F book:SG.M interesting:SG.M All the sentences in the test suite that use the verb "read" intransitively did not parse because the verb was entered in the lexicon only as a transitive. The intransitive was added. ani idy:PAAL.PRES e hia qra:PAAL.PRES-t I know:PAAL.PRES.SG.M that she read:PAAL.PRES.SG.F All the sentences in the test suite with the noun "girl" in the plural did not parse because the plural is irregular in that the last letter of the stem drops before the suffix. I adjusted the test suite to reflect the full stem (ildh-wt) rather than the actual surface form (ild-wt). * h-ild-wt qra:PAAL.PAST-w spr h-ildh-wt qra:PAAL.PAST-w spr the-girl-PL read:PAAL.PAST-3RD.PL book All the senetnces in the test suite with the verb "see" in the present masculine singular did not parse because I had the wrong form in the test suite. I adjusted the test suite. * ath rah:PAAL.PRES-h awtnw ath rah:PAAL.PRES awtnw you:NOM.SG.M see:PAAL.PRES.SG.M us All the sentences in the test suite with the adjective "pretty" in the feminine singular did not parse because the final stem letter drops in the surface form, which is what I had in teh test suite (same as "girl"). I adjusted the test suite. In the process I added ADJ to all the test suite adjectival forms (for ease of reading as they are sometimes identical to present tense verbs and also to avoid having to deal with constant rules and straemline my treatment; so now the third person masculine which has no suffix has the suffix ADJ; this is cheating a little but it simplified things for me). * rxl h-ip-h qra:PAAL.PRES-t spr rxl h-iph:ADJ-h qra:PAAL.PRES-t spr Rachel the-pretty:SG.F read:PAAL.PRES-SG.F book I also discovered this week that some declaratives were not working properly for which I hadn't had the appropriate examples in the test suite last week. I added the sentence below to the test suite and made the necessary change sto the grammar so that they parse correctly. I added a constraint to the clause-embedding-verb-lex item forcing the COMP's COMPS list to be empty, to avoid parsing: * ani idy:PAAL.PRES e I know that Interrogatives: -------------- Hebrew Yes/No questions are formed by preceding the corresponding declarative sentence with a question particle, "h-am", or through uttering the declarative sentence with a rising intonation. The word order within the sentence does not change. hia qra:PAAL.PRES-t she read:PAAL.PRES-SG.F "She reads." hia qra:PAAL.PRES-t she read:PAAL.PRES-SG.F "Does she read?" h-am hia qra:PAAL.PRES-t the-if she read:PAAL.PRES-SG.F "Does she read?" In order to avoid seeing two parses for every S, I created the prop-or-ques-clause forming rule: prop-or-ques-clause := non-rel-clause & [ SYNSEM.LOCAL.CONT.MSG [ MARG #marg ], SYNSEM.LOCAL.CAT.IMPERATIVE -, C-CONT [ RELS , HCONS ], HEAD-DTR.SYNSEM.LOCAL.CONT [ MSG no-msg, HOOK.LTOP #ltop ], HEAD-DTR.SYNSEM.LOCAL.CAT.HEAD verb, HEAD-DTR.SYNSEM.LOCAL.CAT.HEAD.FORM fin, HEAD-DTR.SYNSEM.LOCAL.CAT.IMPERATIVE -, HEAD-DTR.SYNSEM.LOCAL.CAT.VAL [ SPR < >, SUBJ < >, COMPS < >, SPEC < > ], SYNSEM.LOCAL.CAT.VAL [ SPR < >, SUBJ < >, COMPS < >, SPEC < > ], SYNSEM.LOCAL.CONT.MSG [ PRED prop-or-ques_m_rel ] ]. This parses and creates the MRS for all main declarative and interrogative sentences not preceded by the question particle. Just like in English, embedded questions are preceded by a complementizer ("am") which is different from the complementizer of the embedded declaratives ("e"). ani idy:PAAL.PRES e hia qra:PAAL.PRES-t I know that she reads ani idy:PAAL.PRES am hia qra:PAAL.PRES-t I know if she reads I created a little type hierarchy for the three complementizers: comp :+ [ COMPLEMENTIZER-TYPE complementizer-type ]. complementizer-type := *top*. embedded-complementizer := complementizer-type. embedded-interrogative-complementizer := embedded-complementizer. embedded-declarative-complementizer := embedded-complementizer. main-interrogative-complementizer := complementizer-type. Each of the complementizers has its own lexical type definitions: embedded-interrogative-complementizer-lex-item := complementizer-lex-item & [ SYNSEM.LOCAL.CAT.VAL [ COMPS < [ LOCAL.CONT.MSG.PRED question_m_rel, LOCAL.CAT.MC -] > ], SYNSEM.LOCAL.CAT.HEAD.COMPLEMENTIZER-TYPE embedded-interrogative-complementizer ]. embedded-declarative-complementizer-lex-item := complementizer-lex-item & [ SYNSEM.LOCAL.CAT.VAL [ COMPS < [ LOCAL.CONT.MSG.PRED proposition_m_rel, LOCAL.CAT.MC -] > ], SYNSEM.LOCAL.CAT.HEAD.COMPLEMENTIZER-TYPE embedded-declarative-complementizer]. main-interrogative-complementizer-lex-item := complementizer-lex-item & [ SYNSEM.LOCAL.CAT.VAL [ COMPS < [ LOCAL.CONT.MSG.PRED question_m_rel, LOCAL.CAT.MC +] > ], SYNSEM.LOCAL.CAT.HEAD.COMPLEMENTIZER-TYPE main-interrogative-complementizer ]. which correspond to the three lexical entries in lexicon.tdl ("am", "e", an d"h-am", respectively). Just like in English, the verb know takes either "that" or "if" clauses as complements, the verb ask takes only "if" clauses and the verb believe takes only "that" clauses. Neither embedding complementizer is optional. ani idy:PAAL.PRES am hia qra:PAAL.PRES-t I know if she reads ani idy:PAAL.PRES e hia qra:PAAL.PRES-t I know that she reads * ani idy:PAAL.PRES hia qra:PAAL.PRES-t I know she reads ani eal:PAAL.PRES am hia qra:PAAL.PRES-t I ask if she reads * ani eal:PAAL.PRES e hia qra:PAAL.PRES-t I ask that she reads * ani eal:PAAL.PRES hia qra:PAAL.PRES-t I ask she reads ani amn:HIFIL.PRES e hia qra:PAAL.PRES-t I believe that she reads * ani amn:HIFIL.PRES am hia qra:PAAL.PRES-t I believe if she reads * ani amn:HIFIL.PRES hia qra:PAAL.PRES-t I believe she reads This is accomplished in the grammar through definition types for the embedding verbs: clause-embedding-verb-lex := verb-lex & clausal-second-arg-trans-lex-item & [ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >, COMPS < #comps & [ LOCAL.CAT.HEAD comp, LOCAL.CAT.VAL.COMPS < >, LOCAL.CAT.HEAD.COMPLEMENTIZER-TYPE embedded-complementizer, LOCAL.CONT.MSG message ]> ], ARG-ST < #subj,#comps > ]. declarative-clause-embedding-verb-lex := clause-embedding-verb-lex & [ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >, COMPS < #comps & [ LOCAL.CAT.HEAD comp, LOCAL.CAT.VAL.COMPS < >, LOCAL.CONT.MSG.PRED proposition_m_rel ]> ], ARG-ST < #subj,#comps > ]. interrogative-clause-embedding-verb-lex := clause-embedding-verb-lex & [ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >, COMPS < #comps & [ LOCAL.CAT.HEAD comp, LOCAL.CAT.VAL.COMPS < >, LOCAL.CONT.MSG.PRED question_m_rel ]> ], ARG-ST < #subj,#comps > ]. and appropriate lexical entries, as follows: idy_paal := clause-embedding-verb-lex & [ STEM < "idy:PAAL" >, INFLECTED -, SYNSEM.LOCAL.CAT.HEAD.VERB-PRESENT-TENSE-SG-F-SUFFIX-TYPE t-suffix, SYNSEM.LKEYS.KEYREL.PRED "_know_v_rel" ]. amn_hifil := declarative-clause-embedding-verb-lex & [ STEM < "amn:HIFIL" >, INFLECTED -, SYNSEM.LOCAL.CAT.HEAD.VERB-PRESENT-TENSE-SG-F-SUFFIX-TYPE h-suffix, SYNSEM.LKEYS.KEYREL.PRED "_believe_v_rel" ]. eal_paal := interrogative-clause-embedding-verb-lex & [ STEM < "eal:PAAL" >, INFLECTED -, SYNSEM.LOCAL.CAT.HEAD.VERB-PRESENT-TENSE-SG-F-SUFFIX-TYPE t-suffix, SYNSEM.LKEYS.KEYREL.PRED "_ask_v_rel" ]. I added some relevant sentences to the test suite, which the grammar handles correctly: * e hia qra:PAAL.PRES-t that she reads * am hia qra:PAAL.PRES-t if she reads am hia qra:PAAL.PRES-t ani idy:PAAL.PRES if she reads I know I have no explanation for why this is odder than the previous one and will assume for now that it is due to pragmatic reasons. ? am hia qra:PAAL.PRES-t ani eal:PAAL.PRES if she reads I ask * ani idy:PAAL.PRES am e hia qra:PAAL.PRES-t I know if that she reads * ani idy:PAAL.PRES e am hia qra:PAAL.PRES-t I know that if she reads * ani idy:PAAL.PRES e e hia qra:PAAL.PRES-t I know that that she reads * ani idy:PAAL.PRES hia qra:PAAL.PRES-t am I know she reads if * ani idy:PAAL.PRES hia qra:PAAL.PRES-t e I know she reads that e hia qra:PAAL.PRES-t ani amn:HIFIL.PRES that she reads I believe * hia qra:PAAL.PRES-t am ani eal:PAAL.PRES she reads if I ask * hia qra:PAAL.PRES-t e ani amn:HIFIL.PRES she reads that I believe This part of the assignment seemed to be reasonably easy. The semantics seemed to work correctly without any changes to any rules. And then I added the imperatives, and all hell broke loose! Not only weren't the imperatives working correctly but adding them messed up lots of other things. Imperatives ----------- Hebrew has at least 4 ways of expressing imperatives: 1. Through special imperative "tense" verb forms. For most verbs there are 4 second person imperative forms differing in gender and number: akl! eat:PAAL.IMP.2SG.M Eat! 2. Through the future tense. This is supposedly incorrect but is widely used. takl! eat:PAAL.FUT.2SG.M Eat! 3. Through the special word "na" followed by the infinitive. This word means roughly "please", though it is not as polite as "please". It cannot appear alone but only with an infinitival complement. na lakl! please eat:PAAL.infinitive Eat! 4. Hebrew has the equivalent of "Let's eat" bwaw nakl! come:PAAL.IMP.2PL.M eat:PAAL.FUT.1PL Let's eat! I only attempted to handle the first kind of imperative. I added the following: verb :+ [ FORM form ]. form := *top*. imp := form. fin := form. cat :+ [ IMPERATIVE bool ]. imperative-construction-phrase := basic-head-opt-subj-phrase & [ SYNSEM.LOCAL.CAT.IMPERATIVE +, HEAD-DTR.SYNSEM.LOCAL.CAT.IMPERATIVE -, HEAD-DTR.SYNSEM.LOCAL.CAT.HEAD verb, HEAD-DTR.SYNSEM.LOCAL.CAT.HEAD.FORM imp, HEAD-DTR.SYNSEM.LOCAL.CAT.VAL.SUBJ < [ LOCAL.CONT.HOOK.INDEX.PNG.PER second ] >, HEAD-DTR.SYNSEM.LOCAL.CAT.VAL.SPR < >, Himperative-construction-phraseEAD-DTR.SYNSEM.LOCAL.CAT.VAL.SPEC < >, HEAD-DTR.SYNSEM.LOCAL.CAT.VAL.COMPS < > ]. imperative-semantics-clause := imperative-clause & [ HEAD-DTR imperative-construction-phrase, SYNSEM.LOCAL.CAT.IMPERATIVE +, SYNSEM.LOCAL.CAT.VAL.SPR < >, SYNSEM.LOCAL.CAT.VAL.SPEC < >, SYNSEM.LOCAL.CAT.VAL.COMPS < >, HEAD-DTR.SYNSEM.LOCAL.CAT.HEAD verb, SYNSEM.LOCAL.CAT.MC + ]. I encountered many problems while working on imperatives. For example, all of a sudden accusative NPs were accepted in subject position: * at h-spr hlk:PAAL.PRES ACC the-book went To prevent the imperative rule from applying to non-imperative verbs I added the following constraints: head-subj-phrase :+ [ SYNSEM.LOCAL.CAT.HEAD verb & [ FORM fin ] ]. subj-head-phrase :+ [ SYNSEM.LOCAL.CAT.HEAD verb & [ FORM fin ] ]. The constraints on the head-subj and subj-head rules will have to be revised later to accommodate verbless sentences and non-finite verb sentences. The imperative rule offered multiple parses for each imperative and an alternative parse for many other sentences and NPs. Adding the HEAD-DTR imperative-construction-phrase constraint to the imperative-semantics-clause rule stopped this massive overgeneration. However, there is something that is not correct as I am not getting the right sementics. Specifically, I am not getting the MSG.PRED into the indexed MRS. It seems that the problem is somewhere in imperative-construction-phrase rule as when the imperative-semantics-clause rule is allowed to take daughters that are not the output of the imperative-construction-phrase rule the indexed MRS does contain the irght MSG.PRED. I went over the type hierarchy to try to figure out which type does what and compared the last edge of the imperative with the last edge an equivalent non-imperative to see where the differences are. I see that the MSG is not copying in the imperative to some other CONT locations but I can't figure out how to make it work. TSDB Results: I ran the new test suite on the original grammar and then on the lab7 grammar. coverage overgeneration original 3.0 4.5 lab7 34.0 9.1 I haven't had the chance to analyze these results.