If you use Gitkraken, immediately update to version 8.1 (or later) remove your SSH key from https://gitlab.ai.vub.ac.be/-/profile/keys and generate a new one. SSH keys generated with a vulnerable Gitkraken version are compromised.

Commit 93f9fdc7 authored by remivantrijp's avatar remivantrijp
Browse files

Separating dependency from constituent structure. More updates will follow.

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