:- module(eng,[]).

%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), noun(N, Num, countable).


%interrogative (written as irr)

  irr(irr(who)) --> [who].
  irr(irr(what)) --> [what].

%verbs

  verb(verb(knows), singular) --> [knows].
  verb(verb(know), plural) --> [know].  
  verb(verb(teaches), singular) --> [teaches].
  verb(verb(teach), plural) --> [teach].
  verb(verb(studies), singular) --> [studies].
  verb(verb(study), plural) --> [study].
  verb_to_be(verb(is), singular) --> [is].
  verb_to_be(verb(are), plural) --> [are].

%determiners (written as det)

  det(det(every), singular) --> [every].
  det(det(the), _) --> [the].
  det(det(all), plural) --> [all].
  det(det(a), singular) --> [a].
  det(det(a), plural) --> [some].

%preposition (written as prep)

  prep(prep(of)) --> [of].

%nouns

  %proper nouns
  noun(noun(carl), singular, proper) --> [carl].
  noun(noun(john), singular, proper) --> [john].
  noun(noun(maria), singular, proper) --> [maria].
  noun(noun(alberto), singular, proper) --> [alberto].
  noun(noun(jose), singular, proper) --> [jose].
  noun(noun(ramona), singular, proper) --> [ramona].
  noun(noun(bella), singular, proper) --> [bella].

  %countable nouns
  noun(noun(student), singular, countable) --> [student].
  noun(noun(student), plural, countable) --> [students].
  noun(noun(sister), singular, countable) --> [sister].
  noun(noun(sister), plural, countable) --> [sisters].
  noun(noun(brother), singular, countable) --> [brother].
  noun(noun(brother), plural, countable) --> [brothers].

  %uncountable nouns
  noun(noun(english), singular, uncountable) --> [english].
  noun(noun(mathematics), plural, uncountable) --> [mathematics].
  noun(noun(spanish), singular, uncountable) --> [spanish].
