:- module(esp,[]).

%definition of question

  question(q(I,V,NP)) --> irr(I), verb(V, _), noun_phrase(NP, _).
  question(q(I,V,NP)) --> irr(I), verb_to_be(V, Num), noun_phrase(NP, Num).

%noun phrase breakdown

  noun_phrase(np([O]), Num) --> obj(O, Num).
  noun_phrase(np([O,P,N]), Num) --> obj(O, Num), prep(P), noun(N, Num, proper, _).

%object breakdown

  obj(obj([N]), Num) --> noun(N, Num, _, _).
  obj(obj([Dt,N]), Num) --> det(Dt, Num, Gender), noun(N, Num, countable, Gender).


%interrogative (written as irr)

  irr(irr(who)) --> [quien].

%verbs

  verb(verb(teaches), singular) --> [ensena].
  verb(verb(teach), plural) --> [ensenan].
  verb(verb(studies), singular) --> [estudia].
  verb(verb(study), plural) --> [estudian].
  verb_to_be(verb(is), singular) --> [es].
  verb_to_be(verb(are), plural) --> [son].

%determiners (written as det)

  det(det(the), singular, female) --> [la].
  det(det(the), singular, male) --> [el].
  det(det(the), plural, female) --> [las].
  det(det(the), plural, male) --> [los].

%preposition (written as prep)

  prep(prep(of)) --> [de].

%nouns

  %proper nouns
  noun(noun(carl), singular, proper, male) --> [carl].
  noun(noun(john), singular, proper, male) --> [john].
  noun(noun(maria), singular, proper, female) --> [maria].
  noun(noun(alberto), singular, proper, male) --> [alberto].
  noun(noun(jose), singular, proper, male) --> [jose].
  noun(noun(ramona), singular, proper, male) --> [ramona].
  noun(noun(bella), singular, proper, female) --> [bella].

  %countable nouns
  noun(noun(sister), singular, countable, female) --> [hermana].
  noun(noun(sister), plural, countable, female) --> [hermanas].
  noun(noun(brother), singular, countable, male) --> [hermano].
  noun(noun(brother), plural, countable, male) --> [hermanos].

  %uncountable nouns
  noun(noun(english), singular, uncountable, male) --> [ingles].
  noun(noun(mathematics), singular, uncountable, female) --> [matematica].
  noun(noun(spanish), singular, uncountable, male) --> [espanol].
