=== Lab 4 Cleanup == 

* My sentences with an overt object are parsing twice because my no-drop lexical rule is optional.  Went into the Matrix to fix this on the Argument Optionality page (under Object Dropping, I'd originally had "when an object is dropped, the object marker on the verb is required" and "when an object is overt, an object marker on the verb is not permitted" and now I have: "when an object is dropped, the object marker on the verb is optional" and "when an object is overt, an object marker on the verb is not permitted".  I'd originally forgotten about the optional transitivity of my main verb, 'manger' (to eat), which can have a "dropped" object with no marker.)  Along with this, I also changed my inanimate_obj_pronoun verb prefixes to be optional - when they're not optional, my sentences with an overt object parse only once, however, it keeps my objectless sentences from parsing at all.  

The scenario I need is apparently something the customization system cannot handle in its current state.  A fix is being worked on, however, thanks to dependencies, it'll take longer than I have.  I have been looking into and working on a work around, however, whenever I go to implement it, I find something else that's actually in the lab to work on.  

* I noticed i hadn't implemented Object-dropping markers with tenses other than present.  Added support for this, and sentences to the test suite.  It was a simply matter of adding these verbal inflections to the inputs of the object marking prefix in the customization system.  

* I also noticed that sentences with the question particle est-ce-que accept subject-verb inversion in its complement, making those sentences double interrogative.  From your Lab 4 comments, I know I have to add [ INV -] to the COMPS of est-ce-que.  I tried this in lexicon.tdl (using the PRED as a model), and I tried making a lexical rule that added this to the COMPS list of a qpart-lex-item (using the adjective agreement as a model): 

ques-particle-removing-inv-minus-lrule := const-ltow-rule & 
  [ DTR qpart-lex-item] & 
  [ SYNSEM.LOCAL.CAT.VAL.COMPS < [ INV -] > ]. 

but this isn't keeping the est-ce-que + O-V sentences from parsing.. 

* Am attempting to implement the -ci and -là demonstrative suffixes.  [ incr tsdb()] now considers these non-parses (0) rather than unrecognized tokens (-1) 

== TODO: ==   
* Fix the optional no-drop rule thing.
* Make the -ci and -là sentences parse, and add COG-ST to them. 
* My negated sentences doubly parse thanks to there being 2 negating particles: the ne- prefix, and the pas adverb.  I need to fix this. 

 
=== Lab 5 === 

== Adverbs ==

When I configured my adverbs, I set the value to [ POSTHEAD + ].  My descriptive  grammar states that adverbs immediately follow the verb (including the auxiliary), however, it sounds more natural to me that it go at the end of the sentence.  I believe this is an anglicism.  Regardless, apparently [ POSTHEAD + ] means it goes anywhere after the verb, and the sentences parse with the adverb in both locations, albeit with some ambiguity.  If it is an anglicism, I'll have to figure out a way to keep them from appearing in sentence final position.  I am checking with some native speakers on this (one of whom is from France, and will be immune to the tendencies of Canadian English, or Franglais, as we call it).  

To implement this, I added the following to french.tdl: 

adverb-lex := basic-adverb-lex & intersective-mod-lex & 
  [ SYNSEM [ LOCAL [ CAT [ HEAD.MOD < [ LOCAL.CAT.HEAD verb ] >,
                           VAL [ SPR < >,
                                 SUBJ < >, 
                                 COMPS < >, 
                                 SPEC < > ],
                            POSTHEAD + ]]]].

I do have some problems with my parses where the adverb is appearing in the following places:
- as the complement of a V in a VP  (correct)
- as the complement of a VP, which is the daughter of a VP 
- as the complement of the S 

.. for an example of these trees, try "je mange lentement" 

I also added an adverb to my lexicon.tdl: 

lentement := adverb-lex &
   [ STEM < "lentement" >,
     SYNSEM.LKEYS.KEYREL.PRED "_slowly_adv_rel" ]. 

== Adjectives ==

To recap: Adjectives of nationality, physical characteristics, etc appear after the noun (POSTHEAD +].  Adjectives such as beau/belle, grand, petit, dernier appear before [POSTHEAD -].

As subtypes of adjective-lex, I made prehead-adj-lex and posthead-adj-lex:

prehead-adjective-lex := adjective-lex  &
  [ SYNSEM [ LOCAL [ CAT [ HEAD.MOD < [ LOCAL.CAT [ HEAD noun,
                                                    VAL.SPR cons ]] >,
                           VAL [ SPR < >,
                                 SUBJ < >,
                                 COMPS < >,
                                 SPEC < > ],
                                 POSTHEAD - ]]]].

posthead-adjective-lex := adjective-lex &
   [ SYNSEM [ LOCAL [ CAT [ HEAD.MOD < [LOCAL.CAT [ HEAD noun,
                                                  VAL.SPR cons ]] >,
                          VAL [ SPR < >,
                                SUBJ < >,
                                COMPS < >,
                                SPEC < > ],
                                POSTHEAD + ]]]].

adjective-lex := basic-adjective-lex & intersective-mod-lex &
              norm-ltop-lex-item.

= Adjectival Agreement =

Adjectives agree with the noun they're modifying in number and gender, leaving a paradigm of 4:
masc-sing-adj-lex-rule (basically, a 0-rule)
masc plur-adj-lex-rule (adds an s) 
fem-sing-adj-lex-rule (adds an e) 
fem-plur-adj-lex-rule (adds an es) 

To implement this, I added the following to french.tdl: 

masc-sing-adj-lex-rule := const-ltow-rule & add-only-no-ccont-rule & 
  [ DTR adjective-lex ] & 
[ SYNSEM.LOCAL [ CAT.HEAD.MOD.FIRST.LOCAL.CONT.HOOK.INDEX.PNG [ NUM singular,
                                                                GEND masc ] ] ].

masc-plur-adj-lex-rule := infl-ltow-rule &  add-only-no-ccont-rule & 
  [ DTR adjective-lex ] & 
[ SYNSEM.LOCAL [ CAT.HEAD.MOD.FIRST.LOCAL.CONT.HOOK.INDEX.PNG [ NUM plural,     
                                                                GEND masc ] ] ].

fem-sing-adj-lex-rule := infl-ltow-rule & add-only-no-ccont-rule & 
  [ DTR adjective-lex ] & 
[ SYNSEM.LOCAL [ CAT.HEAD.MOD.FIRST.LOCAL.CONT.HOOK.INDEX.PNG [ NUM singular,
                                                                GEND fem ] ] ]. 

fem-plur-adj-lex-rule := infl-ltow-rule &  add-only-no-ccont-rule & 
  [ DTR adjective-lex ] & 
[ SYNSEM.LOCAL [ CAT.HEAD.MOD.FIRST.LOCAL.CONT.HOOK.INDEX.PNG [ NUM plural,
                                                                GEND fem ] ] ]. 


this to irules.tdl:

masc-plur-adj-suffix := 
%suffix (* s)
masc-plur-adj-lex-rule. 

fem-sing-adj-suffix := 
%suffix (* e)
fem-sing-adj-lex-rule. 

fem-plur-adj-suffix := 
%suffix (* es)
fem-plur-adj-lex-rule. 

and this to lrules.tdl:

masc-singular-adj := masc-sing-adj-lex-rule .  

TODO:  
* Depending on the stem, some of the feminine suffixes require a doubles consonant, ex: canadien -> canadienne.  As of now, that double consonant isn't working (but I have no sentences in the test suite with this inflection).  

== Demonstratives and markers of definiteness == 

= Demonstratives = 

Demonstratives are marked by the determiners ce/cet (masc, sing), cette (fem, sing), ces (plur), which mean "This" as in "Cette fille est belle" 'this girl is pretty'.  

Proximity in place and time to the speaker can be marked with the suffixes -ci (here), and -là (there). 

Unfortunately, my attempt to implement a determiner-lexical type that allows 2 things on its RELS list has failed miserably: 

;determiner-lex-supertype := norm-hook-lex-item & basic-zero-arg & 
;  [ SYNSEM [ LOCAL [ CAT [ HEAD det,
;                          VAL [ SPEC.FIRST.LOCAL.COnt.HOOK [ INDEX #ind,
;                                                             LTOP #larg ] ,
;                                SPR < >,
;                                SUBJ < >,
;                                COMPS < > ] ],
;                    CONT.HCONS < ! qeq &
;                                 [ HARG #harg,
;                                   LARG #larg ] ! > ],
;            LKEYS.KEYREL quant-relation &
;                  [ ARG0 #ind,
;                    RSTR #harg ] ] ].

;demonstrative-determiner-lex := determiner-lex-supertype &
;  [ SYNSEM [ LOCAL.CONT.RELS <! [ PRED "exist_q_rel" ] , #altkey & arg1-ev-relation & [ LBL #lbl, ARG1 #arg1 ] !>,
;             LKEYS.ALTKEYREL #altkey ] &
;           [ LOCAL.CAT.VAL.SPEC < [ LOCAL.CONT.HOOK.INDEX [ COG-ST activ+fam, #arg1 ] ] > ] &
;           [  LOCAL.CONT.HOOK.LTOP #lbl ] ].

Was, at last attempt, giving me a misplaced co-reference error at the location of the comma before #arg1 .  

Something I did to try to make this work has also stopped all my demonstrative determiners from working.  

As I said earlier, I did add the suffixes to my lexicon, but didn't add the lexical rules because I was working on supertypes.  I did intend to make lexical rules to add the COG-ST activ+fam to them.  

= Markers of Definiteness = 

French marks definiteness with the direct article, le (masc sing), la (fem, sing), les (plural), which I had implemented in the customization system.  For this lab, I added the COG-ST to these entries in lexicon.tdl: 

le := masc_sg_definite_article-determiner-lex &
  [ STEM < "le" >,
    SYNSEM.LKEYS.KEYREL.PRED "_the_determiner_rel",
    SYNSEM.LOCAL.CONT.HOOK.INDEX [ COG-ST uniq+fam+act ] ] .

;l%27_1 := masc_sg_definite_article-determiner-lex &
;  [ STEM < "l'" >,
;    SYNSEM.LKEYS.KEYREL.PRED "_the_determiner_rel",
;    SYNSEM.LOCAL.CONT.HOOK.INDEX [ COG-ST uniq+fam+act] ].

la := fem_sg_definite_article-determiner-lex &
  [ STEM < "la" >,
    SYNSEM.LKEYS.KEYREL.PRED "_the_determiner_rel",
    SYNSEM.LOCAL.CONT.HOOK.INDEX [ COG-ST uniq+fam+act] ].

;l%27_2 := fem_sg_definite_article-determiner-lex &
;  [ STEM < "l'" >,
;    SYNSEM.LKEYS.KEYREL.PRED "_the_determiner_rel",
;    SYNSEM.LOCAL.CONT.HOOK.INDEX [ COG-ST uniq+fam+act] ].

les := plur_definite_article-determiner-lex &
  [ STEM < "les" >,
    SYNSEM.LKEYS.KEYREL.PRED "_the_determiner_rel",
    SYNSEM.LOCAL.CONT.HOOK.INDEX [ COG-ST uniq+fam+act] ].


== Argument Optionality == 

Objects can be dropped with an overt marker on the verb (the prefix le- (masc, sing), la- (fem-sing), les- (plur)) - this, of course, is ignoring the missing arguments of optionally transitive verbs.  When the object is dropped, the object is considered to be already in focus, as in "What did you do with the potato?"  "I ate it.".  

I demonstrate this in my grammar by adding the following to french.tdl: 

inanimate_obj_pronoun-lex-rule := lexeme-to-lexeme-rule & add-only-no-ccont-rule &
  [ DTR inanimate_obj_pronoun-rule-dtr ].

masc_inanimate_obj_prounoun_verb_prefix-lex-rule := infl-ltol-rule & inanimate_obj_pronoun-lex-rule &
  [ SYNSEM.LOCAL [ CAT.VAL.COMPS.FIRST.OPT + ] ]. ; &
        ;        [ CONT.HOOK.INDEX.OPT-CS in-foc ] ] .

fem_inanimate_obj_pronoun-lex-rule := infl-ltol-rule & inanimate_obj_pronoun-lex-rule &
  [ SYNSEM.LOCAL [ CAT.VAL.COMPS.FIRST.OPT + ] ]. ; ,
        ;            CONT.HOOK.INDEX.OPT-CS in-foc ] ] .

plur_inanimate_obj_pronoun-lex-rule := infl-ltol-rule & inanimate_obj_pronoun-lex-rule &
  [ SYNSEM.LOCAL [ CAT.VAL.COMPS.FIRST.OPT + ] ]. ; ,
        ;            CONT.HOOK.INDEX.OPT-CS in-foc ] ] .


Unfortunately, this in its uncommented form is giving me the following errors: 

ERROR in [MASC/FEM/PLURAL]_INANIMATE_OBJ_PRONOUN-LEX-RULE:
  Unification with constraint of HOOK failed at path ( SYNSEM LOCAL CONT HOOK) 

2 hours, and a lot of investigation later, what was working either (I lost it in a merge) is no longer working. 

== Test Runs == 

= Lab 5 Test Suite against the Lab 4 Grammar = 
- I added a handful of sentences, primarily to investigate the aspects of argument dropping that weren't working, or additional functionality: 

#296 Arg-Opt with future perfective
Source: author
Vetted: f
Judgment: g
Phenom: tam, pro-d
Je le-mangerai 
Je le-mang.erai 
i.1SG it-eat.1SG-FUT-PFV
'I will eat it' 

#297 Arg-Opt with future perfective
Source: author
Vetted: f
Judgment: g
Phenom: tam, pro-d 
le garçon le-mangera 
le garçon le mang.era
the.3SG-masc boy.3SG-masc it-eat.3SG-FUT-PFV
'the boy will eat it' 

#298 ArgOpt with past imperfective
Source: author
Vetted: f
Judgment: g
Phenom: tam, pro-d
je la-mangeais
je la-mang.eais
i.1SG it-eat.1SG-PST-IPFV
'I was eating it' 

#299 ArgOpt with past imperfective
Source: author 
Vetted: f
Judgment: g
Phenom: tam, pro-d
les enfants les-mangaient 
les enfants les-mang.aient
the.3PL child.3PL it-eat.3PL-PAST-IPFV
'the children were eating them.'

#300 Argument-less
Source: author
Vetted: f
Judgment: g
Phenom: arg-st
Je mange
Je mang.e
i.1SG eat.non2SG
'I am eating' / 'I eat' 

#301 
Source: author
Vetted: f
Judgment: g
Phenom: arg-st
tu manges
tu mang.es
you.2SG eat.2SG
'you eat' 

#302 
Source: author
Vetted: f
Judgment: g
Phenom: arg-st
nous mangeons
nous mang.eons
we.1PL eat.1PL 
'we eat' 


Of 303 sentences, I got 309 parses.  
Of 180 Positive Items, I got 293 parses.
Of 123 Negative items, I got 16 parses. 


= Lab 5 Test Suite against the Lab 5 Grammar = 

Of 303 sentences, I got 358 parses.
 - An attempt at double conjunction (je mange et mange et mange) parsed 68 times, so really only 290 parses. 
Of 180 positive items, I got 270 parses
 - Sources of spurious ambiguity: overt objects parsing twice,  adverbs parsing 4 times.  
 - This is offset by demonstrative determiners not parsing.  
Of 123 negative items, I got 20 parses.
 -  Some noun-verb disagreement in the past perfective are parsing now.  I had attempted to add per/gender/number to the auxiliaries, but I guess that was incomplete. 


TODO: Salvage my week.
      Get basic stuff working again.  
