Skip to content

Phrase and Head objects

Mika Hämäläinen edited this page Sep 1, 2017 · 4 revisions

Phrases and heads

Phrase object

When a phrase is created, a Phrase object is instantiated. This object has the following variables you can modify by your self or through syntax_maker's methods:

  1. head contains a Head object, i.e. the head word of the phrase
  2. components a list of components of the phrase derived from the grammar.json. Such as {"subject": "NP", "dir_object": "NP", "indir_object": "NP"}
  3. order the order of components and the head when the phrase is printed as defined in grammar.json. ["subject", "head", "dir_object", "indir_object"]
  4. agreement as in grammar.json. Affects on the head words morphology. { "subject": ["PERS", "NUM"]}
  5. governance added in runtime for verb phrases and adposition phrases according to word specific rules. {"dir_object": {"CASE": "Gen"}, "indir_object": {"CASE": "All"}}
  6. morphology additional rules that can be specified when creating a phrase

Head object

This object stores a lemmatized word form. It has the following variables:

  1. lemma a string containing the word. This may also be None if you need to create phrases that will not be printed such as with pro drop.
  2. pos "part-of-speech" used to get the correct inflection from Omorfi.