Skip to content

Commit

Permalink
Merge pull request #185 from anitzkin/questionrules
Browse files Browse the repository at this point in the history
A couple of fixes . . . .
  • Loading branch information
linas committed Oct 28, 2014
2 parents 8d137ef + 2abac08 commit 0fda448
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
40 changes: 29 additions & 11 deletions data/relex-semantic.algs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ INV-SUBJECT_LINKING
<F_L str> != than
=
<F_L subj> = <F_R subj>
#TemplateActionAlg
IMP-SUBJECT-ASSIGNMENT
; assigning the imperative subject
<LAB> = \Wi\.*
<F_R subj> = %
=
<F_R subj> = <F_L ref>
;
; "Mr. Smith is late." (as opposed to "The late Mr. Smith")
; But Pa must connect to copula, so reject "The rose smelled sweet"
Expand Down Expand Up @@ -800,7 +807,7 @@ FILLER_FIX
;
#TemplateActionAlg
QUESTION2
<LAB> = \D\.\.w\.*
<LAB> = \D\.\.w\.*|JQ
=
<F_R ref QUERY-FLAG> = T
<F_L wall sentence_type> = QUERY
Expand Down Expand Up @@ -862,6 +869,16 @@ WHEN
<F_L ref QUERY-TYPE> = when
<F_L head-question-word ref links _%atTime> = <F_L ref>
;
; This alg failed to do anything, but I'm still working on it . . .
;
;
;#TemplateActionAlg
;ATORBYWHATTIME
;<LAB> = \D\.*
;<F_L ref QUERY-TYPE> = when
;=
;<F_L head-question-word ref links _%atTime> = <F_L ref>
;
#TemplateActionAlg
; This algoritm was modified to exclude cases where there isn't a todo
; link followed by a verb
Expand Down Expand Up @@ -972,11 +989,10 @@ DO_QUESTION1
<F_R ref QUERY-FLAG> = T
;
;
; SPECIAL RULE FOR COPULA-Questions: "Who/What is the cat?"
; Prevents "who" from acting as the subject.
; Instead, "cat" will act as the subject and a query variable
;
;
;SPECIAL RULE FOR COPULA-Questions: "Who/What is the cat?"
; "Prevents "who" from acting as the subject.
; Instead, "cat" will act as the subject and the object as query variable"
; (DIDN'T WORK THEREFORE COMMENTED-OUT FOR NOW)
;
;#TemplateActionAlg
;COPULA_QUESTION1
Expand All @@ -985,10 +1001,11 @@ DO_QUESTION1
;<subj QUERY-FLAG> = T
;<obj> != %
;=
;<subj> = %
;<subj> = <obj>
;<subj QUERY-FLAG> = T
;<obj> = %
;<obj name> = _$qVar
;<obj ref name> = _$qVar
;<obj QUERY-FLAG> = T
;<subj QUERY-FLAG> = %
;
; /////////////////////////////////////////////////////////////////////
;
Expand Down Expand Up @@ -2365,13 +2382,13 @@ QUANTIFIERS_1
NUMBER-1
<LAB> = \D\.*|\NW\.*
<LAB> != \D..y
<LAB> != \D..w
<LAB> != \D..wc
<LAB> != \D..w.
<LAB> != \Dmcn
<F_L DETERMINER_FLAG> != T
<F_L QUERY_INDEFINATE_DETERMINER_FLAG> != T
<F_L POSSESSIVE-FLAG> != T
<F_L QUANTITY-EXCEPTION-FLAG> != T
<F_L QUERY-FLAG> != T
=
<F_R ref links _quantity> = <F_L ref>
<F_L IS-NUMBER-FLAG> = T
Expand Down Expand Up @@ -3339,6 +3356,7 @@ COPULA_QUESTION1
<head> = %
<head> = $O
<head COPULA-QUESTION-FLAG> = T

; For cases such "Where did hugo plan to go?" we force the location link upon go
#TemplateActionAlg
WHERE_HACK_FOR_QP
Expand Down
14 changes: 6 additions & 8 deletions data/relex-tagging.algs
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@
;
;/////////////////////////////////////////////////////////////////////////////
;
; Step 0: Add a subject to a subjectless imperative sentence first so that it
; can get tagged and eventually end up showing up in a dependency relation although
; it's not there on the surface.
; Prepare a subject for a subjectless imperative sentence (to be linked in the sem-algs)
; -- NB: we should probably use this strategy to add other imvisible
; constitutents to other setence-types. e.g. How much (money) does it cost?
;
; The action section below is inelegant however, I found that just <ref> didn't work whereas this does.
; (NB: there are probably other implicit consituents in other sentence types we should add in this step . . .)

#TemplateActionAlg
ADDIMPSUBJ
<LAB> = \Wi\.*
=
<F_L str> = you
<F_L ref> = you
<F_R subj> = you
<F_R subj> = %

;////////////////////////////////////////////////////////////////////////////
;
Expand Down Expand Up @@ -273,8 +270,9 @@ POS_VERB_INVERTED
#TemplateActionAlg
POS_NOUN
<F_L POS> = WORD
<LAB> = \S\.*|\SX\.*|\SF\.*|\AN\.*|\GN\.*|\YS\.* |\YP\.*|Mp|MF
<LAB> = \S\.*|\SX\.*|\SF\.*|\AN\.*|\GN\.*|\YS\.* |\YP\.*|\Wi\.*|Mp|MF
=
<F_L POS> = noun
;
; BI: "That is what the man said" -- tag "what" as noun; it'll get tagged
; with a pronoun flag later.
Expand Down

0 comments on commit 0fda448

Please sign in to comment.