Name: | FirstConstD_cgn_V4 |
Author: | DANIEL\Erwin |
Goal: | Find first constituents in CGN that contain a "d-word" |
Comments: | Find all first constituents in clauses: (1) labeled as SMAIN (2) having a subject (edge marked as SU) (3) having a finite verb (marked as HD) (4) not containing a subclase (SSUB etc) Compare the first constituents as above with those that have: (5) a descendant word with a POS classifying it as D-word History: 2/7/2011 ERK Created predecessor daar_cgn 5/7/2011 ERK Derived version FirstConstD_cgn_V2 15/7/2011 ERK Derived version FirstConstD_cgn_V4, which also checks for D-adverbs |
Last change: | 2/7/2011 16:36:24 (created: vrijdag 15 juli 2011 17:27) |
Project type: | Negra-tig |
Queries: | D:\Data Files\Corpora\CorpusStudio\CgnXq |
Output: | D:\Data Files\Corpora\CorpusStudio\FirstConstituent |
Sources: | D:\Data files\Corpora\CGN\data\annot\xml\tig\*.tig |
Period Info: | d:\data files\corpora\CorpusStudio\query\CgnPeriod.xml(changed:maandag 11 juli 2011 14:08) |
Parameters: | Prec=3 Foll=1 |
Line | Input | Query | Output | Result | Cmp | Exmp | Goal |
1 | Source | matFirstConst | matFirstConst | matFirstConst | - | + | Find the first constituent in main clauses |
2 | 1/out | matFirstConst-Dvnw | matFirstConstDword | matFirstConstDword | + | + | Find the first constituent in main clauses containing a D-word that is classified as pronoun (vnw) |
3 | 2/cmp | matFirstConst-Dadv | matFirstConst-Dadv | matFirstConst-Dadv | + | + | Find the first constituent in main clauses containing a D-word that is classified as adverb (bw) |
4 | 3/cmp | matFirstConst | matFirstConst-Rest | matFirstConst-Rest | - | + | Find the first constituent in main clauses which do not have Dvnw or Dadv |
5 | Source | matS+V+O | matS+V+O | matS+V+O | - | + | |
6 | Source | anyDaar | anyDaar | anyDaar | - | + | Find any occurrance of D-words |
7 | Source | anyDadv | anyDadv | anyDadv | - | + | Find any occurrance of D-adverbs |
$_matrixIP | "SMAIN"; |
$_anyClause | "S*|INF*"; |
$_head | "HD"; |
$_subject | "SU"; |
$_Dword | "VNW19|VNW20|VNW21"; |
$_Dadv | "daar*|d'r*|der*|dan|er*|hier*|toen|waar*"; |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\anyDaar.xq |
Goal: | Find any occurrance of D-words |
Comment: | Restrict our searches to D-words of type VNW19, VNW20, VNW21 |
Changed: | vrijdag 15 juli 2011 16:07 (created: zaterdag 2 juli 2011 19:36) |
Query: | { for $search in //t[tb:Like(@pos, $_Dword)] where ( exists($search) ) return tb:MyForest($search) } |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\matFirstConst.xq |
Goal: | Find the first constituent in main clauses |
Comment: | Select and show the first constituent. Conditions: (1) Main clause (2) It must have a subject (3) It must have a finite verb (marked as "HD") |
Changed: | vrijdag 15 juli 2011 16:07 (created: maandag 4 juli 2011 15:05) |
Query: | { for $search in //nt[tb:Like(@cat, $_matrixIP)] (: Only take into account clauses with a subject :) let $sbj := ru:one($search, 'child', 'label', $_subject) (: Get the HEAD of the main clause -- that should be the finite verb :) let $Vfin := ru:one($search, 'firstchild', 'label', $_head) (: Get the first constituent: the constituent preceding $Vfin, highest in rank :) let $firstCns := ru:one($Vfin, 'prechigh') (: Show this constituent :) let $msg := concat('First const = [', tb:Phrase($firstCns), ']') (: Define your 'where' definition here :) where ( exists($sbj) and exists($Vfin) and exists($firstCns) and not(tb:Like($firstCns/@cat, $_anyClause)) and not(ru:one($firstCns, 'Descendant', 'cat', $_anyClause)) ) return tb:MyForestMsg($search, $msg) (: ============ subcategorisation on the first constituent type =========== return tb:MyForestCatMsg($search, tb:Category($firstCns), $msg) ======================================================================== :) } |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\matFirstConst-Dvnw.xq |
Goal: | Find the first constituent in main clauses containing a D-word that is classified as pronoun (vnw) |
Comment: | Show all first constituents with a D-word D-word is defined in $_Dword (as: VNW19, VNW20, VNW21) |
Changed: | vrijdag 15 juli 2011 16:07 (created: dinsdag 5 juli 2011 13:38) |
Query: | { for $search in //nt[tb:Like(@cat, $_matrixIP)] (: Only take into account clauses with a subject :) let $sbj := ru:one($search, 'child', 'label', $_subject) (: Get the HEAD of the main clause -- that should be the finite verb :) let $Vfin := ru:one($search, 'firstchild', 'label', $_head) (: Get the first constituent: the constituent preceding $Vfin, highest in rank :) let $firstCns := ru:one($Vfin, 'prechigh') (: Get the category of the first constituent :) let $cat := tb:Category($firstCns) (: Get the actual phrase of the first constituent :) let $phr := tb:Phrase($firstCns) (: Show this constituent :) let $msg := concat('First const = [', $phr, ']') (: Show some trace output :) let $trc := concat('FirstConstDword (', $search/@id, ') cat=', $cat, ' [', $phr, ']\n') (: Define your 'where' definition here :) where ( ru:Trace($trc) and exists($sbj) and exists($Vfin) and exists($firstCns) and not(tb:Like($firstCns/@cat, $_anyClause)) and not(ru:one($firstCns, 'Descendant', 'cat', $_anyClause)) and ru:one($firstCns, 'Descendant', 'pos', $_Dword) ) return tb:MyForestCatMsg($search, $cat, $msg) } |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\matS+V+O.xq |
Goal: | Find main clauses having S-V-O word order |
Comment: | Find main clauses (SMAIN) with: (1) Subject (marked as "SU") (2) finite verb (marked as "HD") (3) a noun-phrase object (4) The order must be S-V-O |
Changed: | vrijdag 15 juli 2011 16:07 (created: maandag 11 juli 2011 7:47) |
Query: | { for $search in //nt[tb:Like(@cat, $_matrixIP)] (: Find subject, finite verb and object :) let $sbj := ru:one($search, 'child', 'label', 'SU') let $vfin := ru:one($search, 'child', 'label', 'HD') let $obj := ru:one($search, 'child', 'label', 'OBJ1', 'cat', 'NP') (: prepare a message to show the constituents :) let $msg := concat('s=[', tb:Phrase($sbj), '] v=[', tb:Phrase($vfin), '] o=[', tb:Phrase($obj), ']') where ( exists($sbj) and exists($vfin) and exists($obj) and ru:relates($sbj, $vfin, 'Precedes') and ru:relates($vfin, $obj, 'Precedes') ) return tb:MyForestMsg($search, $msg) } |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\matFirstConst-Dadv.xq |
Goal: | Find the first constituent in main clauses containing a D-word that is classified as adverb (bw) |
Comment: | Show all first constituents with a D-word D-adv is defined in $_Dadv (as a particular subset of BW) |
Changed: | vrijdag 15 juli 2011 16:07 (created: vrijdag 15 juli 2011 15:21) |
Query: | { for $search in //nt[tb:Like(@cat, $_matrixIP)] (: Only take into account clauses with a subject :) let $sbj := ru:one($search, 'child', 'label', $_subject) (: Get the HEAD of the main clause -- that should be the finite verb :) let $Vfin := ru:one($search, 'firstchild', 'label', $_head) (: Get the first constituent: the constituent preceding $Vfin, highest in rank :) let $firstCns := ru:one($Vfin, 'prechigh') (: Get the category of the first constituent :) let $cat := tb:Category($firstCns) (: Get the actual phrase of the first constituent :) let $phr := tb:Phrase($firstCns) (: Show this constituent :) let $msg := concat('First const = [', $phr, ']') (: Show some trace output :) let $trc := concat('FirstConstDword (', $search/@id, ') cat=', $cat, ' [', $phr, ']\n') (: Define your 'where' definition here :) where ( ru:Trace($trc) and exists($sbj) and exists($Vfin) and exists($firstCns) and not(tb:Like($firstCns/@cat, $_anyClause)) and not(ru:one($firstCns, 'Descendant', 'cat', $_anyClause)) and ru:one($firstCns, 'Descendant', 'pos', 'BW', 'word', $_Dadv) ) return tb:MyForestCatMsg($search, $cat, $msg) } |
File: | D:\Data Files\Corpora\CorpusStudio\CgnXq\anyDadv.xq |
Goal: | Find any occurrance of D-adverbs |
Comment: | Look at 'BW' types, and restrict our search to $_Dadv words |
Changed: | vrijdag 15 juli 2011 16:07 (created: vrijdag 15 juli 2011 16:06) |
Query: | { for $search in //t[@cat = 'BW' and tb:Like(@word, $_Dadv)] where ( exists($search) ) return tb:MyForest($search) } |