Commit 93f9fdc7 authored by remivantrijp's avatar remivantrijp

Separating dependency from constituent structure. More updates will follow.

parent 161ce17a
......@@ -57,8 +57,8 @@
(left-pole-structure
base-transient-structure)
unit-tree)))))
(old-boundaries (fcg::fcg-get-boundaries base-transient-structure))
(new-boundaries (fcg::update-list-of-boundaries old-boundaries temp-node))
(old-boundaries (fcg-get-boundaries base-transient-structure))
(new-boundaries (update-list-of-boundaries old-boundaries temp-node))
(new-form-constraints (infer-all-constraints-from-boundaries
new-boundaries
(get-updating-references cxn-inventory)
......
......@@ -48,17 +48,11 @@
(syn-cat ((is-matrix-clause -)
(agreement ?agreement))))
(intransitive-clause (clause)
(syn-cat ((clause-type intransitive)))
(functional-structure ((subject ?subject))))
(syn-cat ((clause-type intransitive))))
(transitive-clause (clause)
(syn-cat ((clause-type transitive)))
(functional-structure ((subject ?subject)
(object ?object))))
(syn-cat ((clause-type transitive))))
(ditransitive-clause (transitive-clause)
(syn-cat ((clause-type ditransitive)))
(functional-structure ((subject ?subject)
(object ?object)
(dative ?dative))))
(syn-cat ((clause-type ditransitive))))
;; Phrases
;; ---------------------------------------------------------------
(phrase ()
......@@ -86,9 +80,7 @@
(VP (phrase)
(ev-args (?ref-ev ?perf-ev ?asp-ev ?ev))
(head ?verb)
(sem-valence ((actor ?actor) (undergoer ?undergoer)))
(sem-cat ((sem-function predicating-expression)
(emphasis ?emphasis)))
(sem-cat ((sem-function predicating-expression)))
(syn-cat ((phrase-type VP)
(tam ((tense ?tense)
(aspect ((perfect ?perf)
......@@ -117,8 +109,7 @@
(syn-cat ((categories (noun))
(agreement ?agr))))
(common-noun (noun)
(syn-cat ((categories (noun common-noun))
(lex-class common-noun))))
(syn-cat ((lex-class common-noun))))
(compound (noun))
(proper-noun (noun)
(syn-cat ((categories (noun proper-noun))
......@@ -127,16 +118,13 @@
(referent ?ref)
(args (?output ?input))
(sem-cat ((sem-class predicate)))
(syn-cat ((categories (adjective predicate))
(syn-function adjectival)
(agreement ?agr))))
(syn-cat ((lex-class adjective))))
(determiner ()
(referent ?ref)
(args (?ref ?input))
(syn-cat ((categories (determiner)))))
(syn-cat ((lex-class determiner))))
(article (determiner)
(syn-cat ((categories (article determiner))
(lex-class article))))
(syn-cat ((lex-class article))))
))
;;; 2. Definition of a CATEGORY-SPEC.
......@@ -229,4 +217,4 @@
("VBZ" verb)
("DT" determiner)
("JJ" adjective)
("PRP$" possessive-pronoun)))
("PRP$" possessive-pronoun)))
\ No newline at end of file
......@@ -56,7 +56,7 @@
word-specs)
(word-dependency-spec-node-id head-word-spec)))
(defun handle-functional-unit (function head-word-spec unit-name parent-name word-specs)
(defun handle-functional-unit (function head-word-spec unit-name parent-name word-specs &optional preprocessed-units)
"Handle functional units such as nsubj, dobj, dative, and so on."
(let* ((head-id (word-dependency-spec-node-id head-word-spec))
(subunit-names (list (word-dependency-spec-unit-name head-word-spec)))
......@@ -67,7 +67,9 @@
(find-all-features-for-category
(english-retrieve-category head-word-spec)
*english-grammar-categories*
:features-so-far `((parent ,unit-name))))
:features-so-far `((parent ,unit-name)
,@(unit-body (assoc (word-dependency-spec-unit-name head-word-spec)
preprocessed-units)))))
;; Then we collect other subunits in a way that is as flat as possible.
(loop for spec in word-specs
;; We found a subunit other than the Head
......@@ -85,13 +87,14 @@
(handle-verbal-root spec word-specs
(if (subject-p (word-dependency-spec-syn-role spec))
'clausal-subject 'subclause)
unit-name new-unit-name)
unit-name new-unit-name preprocessed-units)
;; Else treat it as a simple functional unit.
(handle-functional-unit (word-dependency-spec-syn-role spec)
spec
new-unit-name
unit-name
word-specs)))
word-specs
preprocessed-units)))
;; If not, collect the lexical features.
(progn
(push (word-dependency-spec-unit-name spec) subunit-names)
......@@ -99,12 +102,14 @@
(find-all-features-for-category
(english-retrieve-category spec)
*english-grammar-categories*
:features-so-far `((parent ,unit-name)))))))))))
:features-so-far `((parent ,unit-name)
,@(unit-body (assoc (word-dependency-spec-unit-name spec)
preprocessed-units))))))))))))
(cons `(,unit-name
,@(cond
((core-function-p function)
(find-all-features-for-category 'NP *english-grammar-categories*
:features-so-far `((subunits ,subunit-names)
:features-so-far `((constituents ,subunit-names)
(head ,(word-dependency-spec-unit-name head-word-spec))
(parent ,parent-name))))
(t
......@@ -118,7 +123,7 @@
(t
'NP))))
(find-all-features-for-category phrase-type *english-grammar-categories*
:features-so-far `((subunits ,subunit-names)
:features-so-far `((constituents ,subunit-names)
(head
,(word-dependency-spec-unit-name head-word-spec))
(parent ,parent-name)))))))
......@@ -144,7 +149,8 @@
(defun handle-verbal-root (root-spec &optional word-specs
(clause-type 'matrix-clause)
(parent '-)
(clause-unit-name (make-const "clause")))
(clause-unit-name (make-const "clause"))
preprocessed-units)
"If the root is verbal, we build a CLAUSE."
(let* (;; We take the node-id of the root verb as the CLAUSE-NUMBER.
(clause-number (word-dependency-spec-node-id root-spec))
......@@ -163,7 +169,9 @@
,@(find-all-features-for-category
(english-retrieve-category word-spec)
*english-grammar-categories*
:features-so-far `((parent ,vp-unit-name))))))
:features-so-far `((parent ,vp-unit-name)
,@(unit-body (assoc (word-dependency-spec-unit-name word-spec)
preprocessed-units)))))))
;; We also look for midposition adverbs.
(verb-units-2 (loop for word-spec in word-specs
when (and (adverbial-modifier-p word-spec)
......@@ -180,7 +188,9 @@
,@(find-all-features-for-category
(english-retrieve-category word-spec)
*english-grammar-categories*
:features-so-far `((parent ,vp-unit-name))))))
:features-so-far `((parent ,vp-unit-name)
,@(unit-body (assoc (word-dependency-spec-unit-name word-spec)
preprocessed-units)))))))
(verb-units (append verb-units-1 verb-units-2))
(verb-unit-names (mapcar #'unit-name verb-units))
;; Now handle the functional units.
......@@ -211,9 +221,9 @@
word-specs
(if (subject-p function)
'clausal-subject 'subclause)
clause-unit-name unit-name)
clause-unit-name unit-name preprocessed-units)
(handle-functional-unit
function word-spec unit-name clause-unit-name word-specs))))
function word-spec unit-name clause-unit-name word-specs preprocessed-units))))
(clause-subunits (append (listify subject-unit-name)
(listify object-unit-name)
(listify dative-unit-name)
......@@ -222,28 +232,28 @@
(append `(;; The main clause.
(,clause-unit-name
,@(find-all-features-for-category clause-type *english-grammar-categories*
:features-so-far `((subunits ,clause-subunits)
(parent ,parent)
(functional-structure
(,@(when subject-unit-name
`((subject ,subject-unit-name)))
,@(when object-unit-name
`((object ,object-unit-name)))
,@(when dative-unit-name
`((dative ,dative-unit-name))))))))
:features-so-far `((constituents ,clause-subunits)
(parent ,parent))))
;(functional-structure
; (,@(when subject-unit-name
; `((subject ,subject-unit-name)))
; ,@(when object-unit-name
; `((object ,object-unit-name)))
; ,@(when dative-unit-name
; `((dative ,dative-unit-name))))))))
;; The VP and its subunits.
(,vp-unit-name
,@(find-all-features-for-category
'VP *english-grammar-categories*
:features-so-far `((subunits ,verb-unit-names)
:features-so-far `((constituents ,verb-unit-names)
(parent ,clause-unit-name)
(functional-structure
(,@(when subject-unit-name
`((subject ,subject-unit-name)))
,@(when object-unit-name
`((object ,object-unit-name)))
,@(when dative-unit-name
`((dative ,dative-unit-name)))))
;(functional-structure
; (,@(when subject-unit-name
; `((subject ,subject-unit-name)))
; ,@(when object-unit-name
; `((object ,object-unit-name)))
; ,@(when dative-unit-name
; `((dative ,dative-unit-name)))))
(head ,(word-dependency-spec-unit-name root-spec))))))
verb-units
;; The functional units.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment