60 | | deriving implicit out-of-vocabulary type information |
| 60 | deriving implicit out-of-vocabulary type information. |
| 61 | |
| 62 | Actual AST implementation is ale to process inputs form [https://nlp.fi.muni.cz/trac/synt SYNT] ad [https://nlp.fi.muni.cz/trac/set SET] parsers. The previous example of syntactic tree is from output of SYNT parser. |
| 63 | |
| 64 | The example of SET tree in textual form for sentence "Tom wants to buy a new car but he will not buy it.": |
| 65 | |
| 66 | {{{ |
| 67 | id word:nterm lemma tag pid til schema |
| 68 | 0 N:Tom Tom k1gMnSc1;ca14 p |
| 69 | 1 V:chce chtít k5eAaImIp3nS 15 |
| 70 | 2 V:koupit koupit k5eAaPmF 16 |
| 71 | 3 ADJ:nové nový k2eAgNnSc4d1 17 |
| 72 | 4 N:auto auto k1gNnSc4 17 |
| 73 | 5 PUNCT:, , kIx 10 |
| 74 | 6 CONJ:ale ale k8xC 10 |
| 75 | 7 V:nekoupí koupit k5eNaPmIp3nS 13 |
| 76 | 8 PRON:je on k3xPp3gNnSc4 13 |
| 77 | 9 PUNCT:. . kIx. 10 |
| 78 | 10 <CLAUSE> k5eNaPmIp3nS 12 vrule_sch ( $$ $@ ) |
| 79 | 11 <CLAUSE> k5eAaImIp3nS 12 vrule_sch ( $$ $@ ) |
| 80 | 12 <SENTENCE> -1 |
| 81 | 13 <VP> koupit k5eNaPmIp3nS 10 vrule_sch_add ( $$ $@ "#1H (#2)" ) |
| 82 | 14 <VP> chtít k5eAaImIp3nS 11 vrule_sch_add ( $$ $@ "#2H (#1)" ) |
| 83 | 15 <VP> chtít k5eAaImIp3nS 14 vrule_sch_add ( $$ $@ "#1H (#2)" ) |
| 84 | 16 <VP> koupit k5eAaPmF 15 vrule_sch_add ( $$ $@ "#1H (#2)" ) |
| 85 | 17 <NP> auto k1gNnSc4 16 rule_sch ( $$ $@ "[#1,#2]" ) |
| 86 | }}} |
| 87 | |
| 88 | Visual representation of SET structural tree tree: |
| 89 | |
| 90 | [[Image(set_tree.png, 700px)]] |
| 91 | |
| 140 | |
| 141 | '''Verb Valencies''': the next language dependent file is a file that defines verb |
| 142 | valencies and schema and type information for building the resulting construction from the corresponding valency frame. An example for the verb “jíst” (eat) |
| 143 | is as follows: |
| 144 | |
| 145 | {{{ |
| 146 | jíst |
| 147 | hPTc4 :exists:V(v):V(v):and:V(v)=[[#0,try(#1)],V(w)] |
| 148 | }}} |
| 149 | |
| 150 | This record defines the valency of <somebody> eats <something>, given by the |
| 151 | brief valency frame hPTc4 of the object (an animate or inanimate noun phrase in |
| 152 | accusative), and the resulting construction of the verbal object (V(v)) derived as |
| 153 | an application of the verb (!#0) to its argument (the sentence object) with possible |
| 154 | extensification (try(!#1)) and the appropriate possible world variable (V(w)). |
| 155 | |
| 156 | '''Prepositional Valency Expressions''': the last file that has to be specified for |
| 157 | each language is a list of semantic mappings of prepositional phrases to |
| 158 | valency expressions based on the head preposition. The file contains for each |
| 159 | combination of a preposition and a grammatical case of the included noun |
| 160 | phrase all possible valency slots corresponding to the prepositional phrase. For |
| 161 | instance, the record for the preposition "k" (to) is displayed as |
| 162 | |
| 163 | {{{ |
| 164 | k |
| 165 | 3 hA hH |
| 166 | }}} |
| 167 | |
| 168 | saying that "k" can introduce prepositional phrase of a where-to direction hA |
| 169 | (e.g. "k lesu" – "to a forest"), or a modal how/what specification hH (e.g. "k večeři" |
| 170 | – "to a dinner"). |
| 171 | |
| 172 | = System Parts = |
| 173 | The AST system is implemented in the Python 2.7 programming language and |
| 174 | consists of six main parts: |
| 175 | * the input parser: reads standard input, extracts tree structures and creates tree object for each tree from input, |
| 176 | * the grammar parser: reads the grammar file and assigns a grammar rule and appropriate actions to each node inside the tree, |
| 177 | * the lexical item parser: reads the file with lexical item schemata and TIL types and assigns the type to each leaf in the tree structure, |
| 178 | * the schema parser: according to a logical construction schema coming with a semantic action, this module creates a construction from sub-constructions, |
| 179 | * the verb valency parser: picks up the correct valency for given sentence and triggers the schema parser on sub-constructions according to the schema coming with the valency, and |
| 180 | * the prepositional valency expression parser: reads the possible valency expressions assigned to prepositional phrases used as (optional) valency slots in the actual sentence valency frame. |
| 181 | |
| 182 | |