<commit_before>;
; relex stanford-algs.txt
;
; Rules to extract Stanford-parser-style relationships.
; The goal here is to be as compatible with the Stanford
; parser as possible, given the parse provided by Link-Grammar.
;
;///////////////////////////////////////////////////////////////////////
;
; Transfer prep links to ref.
#TemplateActionAlg
PREP_TO_SF
<ref prep-links> != %
=
<ref sf-links> <= <ref prep-links>

;///////////////////////////////////////////////////////////////////////
;
; GENERATE SF RELATIONS
; Stanford parser generates some relations which relex does not.
; Generate these.
;
; Explicit determiner markup
#TemplateActionAlg
SF_DET
<LAB> = \D\.*
=
<F_R ref sf-links _det> = <F_L ref>
;
; Explicit aux markup.
; "there is a place we can go"  aux(go-7, can-6)
; "The accident happened as the night was falling." aux(falling-8, was-7)
#TemplateActionAlg
SF_AUX
<LAB> = \I\.*|\Pg\.*b
=
<F_R ref sf-links _aux> = <F_L ref>

;///////////////////////////////////////////////////////////////////////
;
; ALTERNATE MARKUP
; Relex generates advmod for some cases where Stanford generates nsubj.
; Here, we have to untangle this stuff.

;///////////////////////////////////////////////////////////////////////
;
; TRANSFER LINKS TO SF-LINKS
;
; Stanford nsubj is just like relex subj
#TemplateActionAlg
SUBJ_TO_SF_LINKS
<HEAD-FLAG> = T
<subj> != %
=
<ref sf-links _nsubj> = <subj>
;
;
#TemplateActionAlg
EXPL_TO_SF_LINKS
<HEAD-FLAG> = T
<expl> != %
=
<ref sf-links _expl> = <expl>
;
#TemplateActionAlg
OBJ_TO_SF_LINKS
<HEAD-FLAG> = T
<obj> != %
=
<ref sf-links _dobj> = <obj>
;
;
#TemplateActionAlg<commit_msg>Get the advcl clauses to work.<commit_after>;
; relex stanford-algs.txt
;
; Rules to extract Stanford-parser-style relationships.
; The goal here is to be as compatible with the Stanford
; parser as possible, given the parse provided by Link-Grammar.
;
;///////////////////////////////////////////////////////////////////////
;
; Transfer prep links to ref.
#TemplateActionAlg
PREP_TO_SF
<ref prep-links> != %
=
<ref sf-links> <= <ref prep-links>

;///////////////////////////////////////////////////////////////////////
;
; GENERATE SF RELATIONS
; Stanford parser generates some relations which relex does not.
; Generate these.
;
; Explicit determiner markup
#TemplateActionAlg
SF_DET
<LAB> = \D\.*
=
<F_R ref sf-links _det> = <F_L ref>
;
; Explicit aux markup.
; "there is a place we can go"  aux(go-7, can-6)
; "The accident happened as the night was falling." aux(falling-8, was-7)
#TemplateActionAlg
SF_AUX
<LAB> = \I\.*|\Pg\.*b
=
<F_R ref sf-links _aux> = <F_L ref>

;///////////////////////////////////////////////////////////////////////
;
; ALTERNATE MARKUP
; Relex generates advmod for some cases where Stanford generates nsubj.
; Here, we have to untangle this stuff.

; The preposition modifies the preceeding phrase
; "The accident happened as the night was falling."
; mark(falling-8, as-4)
; advcl(happened-3, falling-8)

#TemplateActionAlg
ADVCL_OBJECT
<LAB> = MVs|\TH\.*|\WN\.*
<F_R head-word> != %
=
<F_L ref sf-links _advcl> = <F_R head-word ref>


#TemplateActionAlg
ADVCL_COMPLEMENT
<LAB> = MVs|\TH\.*|\WN\.*
<F_R head-word> != %
=
<F_R head-word ref sf-links _mark> = <F_R ref>


;///////////////////////////////////////////////////////////////////////
;
; TRANSFER LINKS TO SF-LINKS
;
; Stanford nsubj is just like relex subj
#TemplateActionAlg
SUBJ_TO_SF_LINKS
<HEAD-FLAG> = T
<subj> != %
=
<ref sf-links _nsubj> = <subj>
;
;
#TemplateActionAlg
EXPL_TO_SF_LINKS
<HEAD-FLAG> = T
<expl> != %
=
<ref sf-links _expl> = <expl>
;
#TemplateActionAlg
OBJ_TO_SF_LINKS
<HEAD-FLAG> = T
<obj> != %
=
<ref sf-links _dobj> = <obj>
;
;
#TemplateActionAlg
{'fraction_non_alphanumeric': 0.2678232583355923, 'fraction_numerical': 0.003252914068853348, 'mean_word_length': 2.124470787468247, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6859572', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1232, 'n_words': 364}