A bigger Spanish grammar fragment

The Noun Phrase

Spanish noun phrases are strongly head-initial: the word order is almost always determiner noun modifiers.

   la       casa       grande
   the.f.sg house.f.sg big.sg
   "the big house"

(A few adjectives can precede the noun, often with changed morphology and semantics. This grammar does not cover these prenominal adjectives, which in any case are fairly rare in the lexicon.)

   la       gran   casa
   the.f.sg big    house.sg
   "the important house"

The determiner always marks both gender and number. Nouns and adjectives are marked for number, but not consistently for gender. On nouns, gender is a lexical property that's not always predictable: most masculine nouns end in -o or a consonant, and most feminine nouns in -a, but there are exceptions.

   el       mapa
   the.m.sg map.m.sg
   "the map"

Similarly, most adjectives will take endings in -o to agree with a masculine noun, and endings in -a to agree with a feminine one, but some adjectives (such as grande above) are invariant for gender.

Unlike in English, a determiner and noun alone can constitute a noun phrase.

   los       viejos
   the.m.sg  old.m.sg
   "the elderly, the old people"

Spanish only has vestigial case marking. The subject and object of a sentence are distinguished by word order, and by subject agreement marking on the verb.

   El       hombre esta    buscando    una       mujer.
   the.m.sg man.sg is.3.sg looking.for a.f.sg    woman.sg
   "The man is looking for a woman."

   La       mujer    esta    buscando    un       hombre.
   the.f.sg woman.sg is.3.sg looking.for a.m.sg   man.sg
   "The man is looking for a woman."

The preposition a has two case-related uses. It marks recipients and goals (in this use, it's sometimes called a dative case marker).

   Vamonos  a     Texas.
   let's.go DAT   Texas
   "Let's go to Texas."

It also marks direct objects that are animate and specific.

   El       hombre esta    buscando    a   una       mujer.
   the.m.sg man.sg is.3.sg looking.for DAT a.f.sg    woman.sg
   "The man is looking for a particular woman [he has one in mind]."

Verbs

Verbs are marked for a number of features: subject agreement (person and number), tense, aspect, mood and voice. This grammar only includes a subset of those features. I've encoded the present-tense endings for all six person and number combinations.

Most verbs fall into one of three conjugations, distinguished by their stem vowel.

-AR VERBS
     Stem . o: 1st sg pres;
     Stem . as: 2nd sg pres;
     Stem . a: 3rd sg pres;
     Stem . amos: 1st pl pres;
     Stem . ais: 2nd pl pres;
     Stem . an: 3rd pl pres;

-ER VERBS
     Stem . o: 1st sg pres;
     Stem . es: 2nd sg pres;
     Stem . e: 3rd sg pres;
     Stem . emos: 1st pl pres;
     Stem . eis: 2nd pl pres;
     Stem . en: 3rd pl pres;

-IR VERBS
     Stem . o: 1st sg pres;
     Stem . es: 2nd sg pres;
     Stem . e: 3rd sg pres;
     Stem . imos: 1st pl pres;
     Stem . is: 2nd pl pres;
     Stem . en: 3rd pl pres;

Some verbs are also irregular. Often, the irregularity involves changes in the stem itself, and so I've chosen to handle these verbs in the grammar by listing all six forms explicitly.

Spanish is pro-drop. Overt subjects are optional in all person/number combinations.

############ [Spanish] ####################
#
#
## [A small Spanish grammar]
## [Dan Velleman, 5/08]
#
# This is a grammar for a fragment of Spanish.  It handles subject/verb agreement, pro-drop, articles, 
# basic relative and subordinate clauses with 'que', and the dative preposition 'a'. 
####################### Features #######################


feature {
  CASE<2>: nom acc dat;
  NUM<2>: sg pl;
  PERS<2>: 1st 2nd 3rd;
  GEND<2>: masc fem;
  DEFINITENESS<2>: def indef;
  TENSE<E>: past pres;
  SEM-NUM<X:NUM>: sg-X pl-X;
  SEM-GEND<2>: masc-X fem-X neut-X;	

  ontology: sem-obj {
              phys-obj {
                animate-being {
                  person
                }
                thing
              }
              situation {
                change {
                  action
                }
                state
              }
            };
}


######################### Words #########################

# Lexical entries for nouns and names.  (The difference between the two is that names
# do not require an article; other nouns do.  I've modelled this by making names full NPs
# and nouns only Ns, and by creating verbs that can only combine with full NPs.)

def masc-noun(Stem, Pred) { 
  word Stem:N (pred=Pred){ 
    Stem . o: sg 3rd masc sg-X masc-X;
    Stem . os: pl 3rd masc pl-X masc-X;
  }
}

def masc-name(Sing, Pred) {
	word Sing:Np (pred=Pred) {
		*: sg 3rd masc sg-X masc-X;
	}
}

def fem-noun(Stem, Pred) { 
  word Stem:N (pred=Pred){ 
    Stem . a: sg 3rd fem sg-X fem-X;
    Stem . as: pl 3rd fem pl-X fem-X;
  }
}
def fem-name(Sing, Pred) {
	word Sing:Np (pred=Pred) {
		*: sg 3rd masc sg-X masc-X;
	}
}

#
# Here are paradigms for the three major verb conjugations.  Setting them 
# up as expansions saves a lot of typing later on when we're adding verbs
# to the lexicon.  
#
# These paradigms are incomplete; full ones would include the preterite,
# imperfect and future tenses, and subjunctive and imperative forms.  But
# there's enough here to give an idea of how this ought to work.
#

def ar-verb(Stem,Family,Pred) {
   word Stem:Family (pred=Pred) {
     Stem . o: 1st sg pres;
     Stem . as: 2nd sg pres;
     Stem . a: 3rd sg pres;
     Stem . amos: 1st pl pres;
     Stem . ais: 2nd pl pres;
     Stem . an: 3rd pl pres;
   }
}

def er-verb(Stem,Family,Pred) {
   word Stem:Family (pred=Pred) {
     Stem . o: 1st sg pres;
     Stem . es: 2nd sg pres;
     Stem . e: 3rd sg pres;
     Stem . emos: 1st pl pres;
     Stem . eis: 2nd pl pres;
     Stem . en: 3rd pl pres;
   }
}

def ir-verb(Stem,Family,Pred) {
   word Stem:Family (pred=Pred){
     Stem . o: 1st sg pres;
     Stem . es: 2nd sg pres;
     Stem . e: 3rd sg pres;
     Stem . imos: 1st pl pres;
     Stem . is: 2nd pl pres;
     Stem . en: 3rd pl pres;
   }
}

#
# Most 'irregular' verbs in Spanish result from some pretty simple sound
# changes.  Still, it's easier just to list the various forms.
#

def irreg-verb(1sg, 2sg, 3sg, 1pl, 2pl, 3pl, Family, Pred) {
	word 1sg:Family (pred=Pred) {
		1sg: 1st sg pres;
		2sg: 2nd sg pres;
		3sg: 3rd sg pres;
		1pl: 1st pl pres;
		2pl: 2nd pl pres;
		3pl: 3rd pl pres;
	}
}

#
# Some adjectives vary for gender: 
#
#               blanco            blanca
#               white.m.sg        white.f.sg
#
# Others don't:
#
#               grande
#               big.sg
#
# Best to list all four forms (masc. and fem., both singular and plural)
# just to be safe.
#

def adjective(SingM, SingF, PlurM, PlurF, Pred) {
	word SingM:Adj (pred=Pred) {
		*: sg masc 3rd sg-X masc-X;
		SingF: sg fem 3rd sg-X fem-X;
		PlurM: pl masc 3rd pl-X masc-X;
		PlurF: pl fem 3rd pl-X fem-X;
	}
}

#
# Here are some content words.  
#
# Note that common nouns and verbs are listed by stem, not by citation
# form.  The paradigms given above will fill in the endings.
#

masc-noun(gat, cat)
masc-noun(nin, boy)
masc-name(Calvin, Calvin)
masc-name(Hobbes, Hobbes)
fem-noun(pelot, ball)
fem-name(Susy, Susy)
adjective(grande, grande, grandes, grandes, big)
ir-verb(viv, IntransV, live)
ar-verb(cant, IntransV, sing)
ar-verb(lav, TransV, wash)
ar-verb(levant, TransV, lift)
ar-verb(bail, IntransV, dance)
irreg-verb(doy, das, da, damos, dais, dan, DitransV, give)
irreg-verb(veo, ves, ve, vemos, veis, ven, TransV, see)
irreg-verb(duermo, duermes, duerme, dormimos, dormais, duermen, IntransV, sleep)
er-verb(cre, PCV, think)
 
#
# Here are just a few function words -- the definite and indefinite article, 
# 'que' as both a relativizer and complementizer, and the dative preposition 'a'.
#

word def-art:Det {
	el: sg masc def;
	la: sg fem def;
	los: pl masc def;
	las: pl fem def;
}

 
word indef-art:Det {
	un: sg masc indef;
	una: sg fem indef;
	unos: pl masc indef;
	unas: pl fem indef;
}

word relativizer:Rel {
	que;
}

word complementizer:Comp {
	que;
}

word a:DatPrep;

#
#
#
######################### Rules #########################
#
################## Lexicon/Categories ####################

#
# Two type-changing rules.
# The first is for pro-drop; it saves us needing separate verb
# forms that don't require an overt subject.
#
# The second raises adjectives to nouns.  In Spanish, Det + N
# is a well-formed noun phrase: 
#
#            los       grandes
#            the.m.pl  big.m.pl
#            "the big ones"
	
rule {
	typechange: s \* np => s;
	typechange: n \* n => np;
}



family Det(indexRel="det") {
	entry: np<2> [X pers=3rd] /* n<2> [X]: X:sem-obj(<det> *);
}

family N {
	entry: n<2> [X]: X:sem-obj(*);
}

family Np {
	entry: np<2> [X]: X:person(*);
}

family Adj {
	entry: n<2> [X] \* n<2> [X] : X:sem-obj(<Prop> *);
}


family IntransV(V) {
  entry: s<1> [E] \* np<2> [X] : E:action(* <Actor>X:animate-being);
}

family TransV(V) {
  entry: s<1> [E] \* np<2> [X] /* np<3> [Y] : 
  E:action(* <Actor>X:animate-being <Patient>Y:sem-obj); 
}

family DitransV(V) {
  entry: s<1> [E] \* np<2> [X] /* np<3> [Z CASE=dat] /* np<4> [Y CASE=acc]  :
  E:action(* <Actor>X:animate-being <Theme>Y:sem-obj <Recipient>Z:sem-obj);
}

family PCV(V) {
  entry: s<1> [E] \* np<2> [X] /* sbar<3> [Y] :
  E:action(* <Experiencer>X:animate-being <Situation>Y);
}

family Rel(indexRel="Relpro") {
	entry: (n<2> [X] \* n<2> [X]) / (s<1> [E] |* np<2> [X]): X(<Rel>E);
}

family Comp {
	entry: sbar<1> [X] /* s<1> [X];
}

family DatPrep {
	entry: np<~2> [X CASE=dat] /* np<2> [X];
}

####################### Testbed #########################



testbed {
	el gato grande: 1;
	el grande gato: 0;               # Adjectives (almost always) follow the noun.
	la grande gato: 0;               # Does gender agreement work within the NP?
	Calvin duerme: 1;       
	Calvin duermes: 0;               # Does person agreement work?
        Calvin duermen: 0;               # How about number?
	dormimos: 2;                     # If pro-drop is working, we should get two parses -- one as a 
                                         # v \ np and one as a complete s.
	el Calvin duerme: 0;             # No articles with names.
	Calvin ve a Hobbes: 1;           
	Calvin ve la pelota: 1;
	Calvin ve a Hobbes a Susy: 0;    # Transitive verbs only license two NPs.
	Calvin da la pelota a Hobbes: 1;
	Calvin da a la pelota Hobbes: 0; # The dative preposition goes with the recipient, not the theme.
	damos la pelota a Susy: 1;
	Susy cree que Calvin ve a Hobbes: 1;
	el nino que baila: 1;
	el nino que ve a Hobbes: 1;
}

 
openccg/grammars/spanish2.txt · Last modified: 2008/05/07 12:50 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki