Lab5 Writeup Test Suite Changes I made some changes in the test suite file before rerunning it through the lab4 grammar. The changes were: 1. Hyphens were replaced with spaces for all the clitics for which there were examples in the test suite (e.g. w-h-nyim became w h-nyim), except for the definiteness marker "h". Likewise hyphens were removed from pronouns (e.g. awt-nw became awtnw). Examples: a. w - and hildh hiph whnyimh qwrat spr. h-ildh h-ip-h w h-nyim-h qra:PAAL.PRES-t spr the-girl:SG.F the-pretty-SG.F and.the-pleasant-SG.F read:PAAL.PRES-SG.F book:SG.M ‘The pretty and pleasant girl is reading a book.’ b. b - in anxnw svwdnvim bawnibrsivh. anxnw svwdnv-im b h-awnibrsivh pron:NOM.1PL student:M-PL in the-university:SG.F ‘We are students at the university.’ c. at - ACC marker in pronouns anxnw rwaim awtnw. anxnw rah:PAAL.PRES-im awtnw pron:NOM.1PL see:PAAL.PRES-PL.M pron:ACC.1PL 'We are seeing us.' 2. When implementing various phenomena I noticed that I did not anticipate certain potential errors when putting together my initial test suite. I added some ungrammatical examples to the test suite. Examples: a. An example of the ACC marker being followed by a pronoun Source: author Vetted: t Judgment: u Phenomena: case ani qwrat at awtw. ani qra:PAAL.PRES-t at awtw pron:NOM.1SG read:PAAL.PRES-SG.F ACC pron:ACC.SG.M ‘I am reading it’ b. An example of the ACC marker being followed by a [DEF -] noun #1637 Source: author Vetted: t Judgment: u Phenomena: case ani qwrat at spr. ani qra:PAAL.PRES-t at spr pron:NOM.1SG read:PAAL.PRES-SG.F ACC book:SG.M ‘I am reading a book’ Agreement: I implemented a person, number, and gender distinction in pronouns. This was done in the lexicon.tdl file by simply typing in the relevant values in each pronominal entry. hm := pronoun-lex & [ STEM < "hm" >, SYNSEM.LOCAL [CAT.HEAD.CASE nom, CONT.HOOK.INDEX.PNG [ PER third, NUM non-sg, GEND masc ] ] ]. I implemented a number and gender distinction in common and proper nouns. The person distinction was implmented via the common-noun-lex type definition in hebrew.tdl. As far as the gender is concerned, the current treatment is probably correct. However, the implmentation for number needs to be changed, time permitting. Right now, there are two entries in the lexicon for each noun, one for the singular and one for the plural. The plural ending may be either "im" or "wt" (except for some exceptions which take something else) but this isn't necessarily predictable from the noun's gender. Still, the neater solution is probably to have one entry per noun, specifying in it what "type" of a plural the nouns takes and a rule that creates the plural with the appropriate ending (and a non-changing rule that creates the singular). But I didn't do this for this week's assignment. spr := common-noun-lex & [ STEM < "spr" >, SYNSEM [LOCAL.CONT.HOOK.INDEX.PNG [ NUM sg, GEND masc ], LKEYS.KEYREL.PRED "_book_n_rel" ] ]. spr-im := common-noun-lex & [ STEM < "spr-im" >, SYNSEM [LOCAL.CONT.HOOK.INDEX.PNG [ NUM non-sg, GEND masc ], LKEYS.KEYREL.PRED "_book_n_rel" ] ]. I implemented gender and number distinction in adjectives as well. This was done by adding the appropriate features in the lexical entries manually. In the future I will write lexeme to lexeme rules that will create the SG.F, PL.M, and PL.F out of SG.M as in the case of adjectives they are more regular and predictable than nouns. There is also one determiner (quantifier) in the lexicon.tdl file which is marked for number (all - non-sg). But I haven't done anything else about dtereminers. Package: The package I picked is the first package. Hebrew has both case and agreement, so I implemented some aspects of case and agreement and included 2 lexical rules. Definitness: Hebrew has an accusative case adposition which appears only in front of definite NPs. So I will discuss definiteness first as it is relevant to case. As mentioned before, Hebrew has a prefix "h" (pronounced "ha") that attaches to common nouns (and adjectives and demonstratives) to make them definite. I am assuming that this "h" prefixation is the last thing that happens to a noun (etc.) before it becomes a word. So following previous e-posts and discussions with you on this, I did the following for nouns (the other two pos will follow later): Noun lexemes are unspecified for DEF. There are two lexeme-to-word rules: One takes a noun and attaches the "h" prefix to it and makes it as [DEF +]; I called it def-h-noun-rule. The other takes a noun and makes it [DEF -] without changing the spelling; I called it indef-noun-rule. Note that these rules should be applicable to common nouns only. The def-h-noun-rule shouldn't apply to the pronouns and proper nouns because they cannot get the "h" prefix, and the indef-noun-rule shouldn't apply to proper nouns and pronouns because they are in fact [DEF +]. So I had to get the grammar to accept pronouns and proper nouns without making them [DEF -] but without allowing them to undergo the "h" prefixation either. The these two rules were written initially, unprefixed pronouns and proper nouns went through the indef-noun-rule and got marked as [DEF -]. If I tried to parse them with the "h" prefix, the def-h-noun-rule happily applied to them. When I marked the pronouns and proper nouns as [DEF +] in the pronoun-lex and proper-noun-lex type definitions, the indef-noun-rule didn't allow them to get through, as expected. So adding that restriction to the pronoun and proper noun type definitions solved one of the two problems. To prevent the def-h-noun-lex from applying to pronouns and proper nouns prefixed with "h" I needed a way to distinguish between common nouns and proper nouns/pronouns. It seemed to me that we didn't have an easy way of distinguishing the three noun types. Dragging all the RELS code into the lexeme-to-word rules seemed messy. So I added subtypes for nouns: noun :+ [ PROPER_PRONOUN_COMMON ppc ]. ppc := *top*. proper_pronoun := ppc. pronoun := proper_pronoun. proper := proper_pronoun. common := ppc. I added the PROPER_PRONOUN_COMMON constraint to the pronoun-lexical and proper-noun-lex and constrained the def-h-noun-rule so that its input must be a common noun. As expected, the prefixed pronouns and proper nouns did not get through the def-h-noun-rule. So all was well, except that now that neither the indef-noun-rule nor the def-h-noun-rule made words out of the pronoun and proper noun lexemes, they could not get through to the bare-np rules. Why? Because I made all my nouns [INFLECTED -] and once you do that the only way for them to be parsed is if some rule makes them [INFLECTED +]. So I needed a third lexeme-to-word rule, one that would make the pronouns and proper nouns [INFLECTED +]. This rule had to be constrained such that it wouldn't apply to common nouns. I added a rule that requires the PROPER_PRONOUN_COMMON value to be proper_pronoun. Things to remember: 1. The rule inherits from const-ltow-rule and not infl-ltow-rul as it doesn't involve any spelling changes, and 2. Initially, the def-proper-pronoun-rule applied to the unprefixed common nouns as if they too were pronouns or proper nouns, so I was getting two parses for each unprefixed common noun. This was because I forgot to add to the common-noun-lex type definition the [PROPER_PRONOUN_COMMON common] bit. Once I did that, everything started working exactly as it should: spr (book) indefinite common h-spr (book) definite common ani (I) definite proper-pronoun rxl (Rachel) definite proper-pronoun h-ani (the I) no parse h-rxl (the Rachel) no parse I also implmented definiteness for adjectives. This was done through lexical rules similar to the ones for nouns. There is one rule that creates adjectives that modify indefinite nouns and one for adjecvtives that modify definite nouns. Here are some relevant sentences, some of which had to be added to the test suite. 1. h-ildh h-ip-h hlk:PAAL.PRES-t - the-girl the-pretty walks 2. * h-ildh ip-h hlk:PAAL.PRES-t - the-girl pretty walks (adjective and noun must agree in definiteness) 3. * ildh h-ip-h hlk:PAAL.PRES-t - girl the-pretty walks (adjective and noun must agree in definiteness) 4. ildh ip-h hlk:PAAL.PRES-t - girl pretty walks 5. * h-ip-h h-ildh hlk:PAAL.PRES-t - the-pretty the-girl walks (adjective must immediately follow the noun) 6. * ip-h ildh hlk:PAAL.PRES-t - pretty girl walks (adjective must immediately follow the noun) 7. hlk:PAAL.PRES-t h-ildh h-ip-h - walks the-girl the-pretty 8. * h-ildh hlk:PAAL.PRES-t h-ip-h - the-girl walks the-pretty (adjective must immediately follow the noun) 9. * h-ildh h-ip-wt hlk:PAAL.PRES-t - the-girl the-pretty walks (lack of number agreement between noun and adj) Case: I implemented the accusative adposition exactly as described in the lab5 instructions. I tested the following sentences, some of which had to be added to the test suite. 1. ani qwrat spr - I read a book 2. * ani qwrat h-spr - I read the-book 3. ani qwrat at h-spr - I read ACC the-book 4. ani qwrat awtw - I read him 5. * ani qwrat at awtw - I read ACC him 6. * ani rwah rxl - I see Rachel 7. ani rwah at rxl - I see ACC Rachel 8. * ani qwrat h-spr at - I read the-book ACC 9. * ani qwrat at spr - I read ACC book 10. * ani qwrat at - I read ACC 11. * ani qwrat ani - I read I After some debugging all sentences worked as they should except for #6 and #10 To handle #6 correctly I need to change: def-proper-pronoun-rule := const-ltow-rule & [ SYNSEM.LOCAL.CONT.HOOK.INDEX.DEF + , SYNSEM.LOCAL.CAT.HEAD.PROPER_PRONOUN_COMMON proper_pronoun, DTR.SYNSEM.LOCAL.CAT.HEAD noun]. and split it into two rules because proper nouns are [DEF +] like pronouns but should be [CASE nom] like common nouns so that they can combine with "at", while pronouns may be either [CASE nom] or [CASE acc] and have to have CASE specified in lexicon.tdl (they do not combine with "at" in either case). I split the rule into two adding the [CASE nom] restriction on proper nouns, all the sentences worked except for #10. I added the constraint to the transitive rule that its COMPS element's COMPS had to be empty. I added some sentences to make sure there is nothing funny going on with noun adjective agreement when they are in object position now that case ahs been added. 12. ani qra:PAAL.PRES-t at h-spr-im h-myniin-im - I read ACC the-books the-interesting 13. *ani qra:PAAL.PRES-t h-spr-im h-myniin-im - I read the-books the-interesting 14. *ani qra:PAAL.PRES-t at spr-im h-myniin-im - I read ACC books the-interesting 15. *ani qra:PAAL.PRES-t at h-spr-im myniin-im - I read ACC the-books interesting 16. ani qra:PAAL.PRES-t spr-im myniin-im - I read books interesting 17. *ani qra:PAAL.PRES-t spr-im h-myniin-im - I read books the-interesting 18. *ani qra:PAAL.PRES-t h-spr-im myniin-im - I read the-books interesting Those all seem to be working fine. I manually added all the nominative and accusative pronouns to the lexicon.tdl file with their agreement and case features values. Finally, I decided to write one additional lexical rule for creating a PAAL.PRES.SG.F verb form out of the PAAL.PRES "stem". This rule is as follows: present-tense-sg-f-verb-iflection-rule := infl-ltow-rule & [ SYNSEM.LOCAL.CAT.VAL.SUBJ < [ LOCAL.CONT.HOOK.INDEX.PNG [ GEND fem, NUM sg ]] >, DTR.SYNSEM.LOCAL.CAT.HEAD verb ]. The inflectional rule adds a "t" as a suffix on the "stem". present-tense-sg-f-verb-iflection := %suffix (* -t) present-tense-sg-f-verb-iflection-rule. I adapted two verb entries in the lexicon.tdl file to test Subject-Verb-Agreement: one instransitive and one transitive. hwlk-t := intransitive-verb-lex & [ STEM < "hlk:PAAL.PRES" >, INFLECTED -, SYNSEM.LOCAL.CAT.VAL.SUBJ < [ LOCAL.CONT.HOOK.INDEX.PNG [ GEND fem, NUM sg ]] >, SYNSEM.LKEYS.KEYREL.PRED "_go_v_rel" ]. and qwra-t := transitive-verb-lex & [ STEM < "qra:PAAL.PRES" >, INFLECTED -, SYNSEM.LOCAL.CAT.VAL.SUBJ < [ LOCAL.CONT.HOOK.INDEX.PNG [ GEND fem, NUM sg ]] >, SYNSEM.LKEYS.KEYREL.PRED "_read_v_rel" ]. In each case, the original rule in lexicon.tdl before this change had the suffix in the stem ("hlk:PAAL.PRES-t" and "qra:PAAL.PRES-t" and no agreement features. I just this to see that it can be done. I am not sure I will attempt to deal with the morphology in the lexicon. There are different verb types and they don't all have this suffix and I might just end up listing all the forms with their inflection in the lexicon with their appropriate agreement feature values listed. I haven't included sentences with the two SVA test cases here in the test suite. The test suite includes other SVA test sentences and they will come into play when I do a more thorough implementation of the lexical rules needed for SVA. The one unresolved issue that I believe I was supposed to handle as part of this lab is demonstratives.