;; Transfer rules for Chinese to English ;; Version 2 ;;updated 4/2/13 ;; Langauge names are optional Chinese (Chinese) English (English) ;; ---------------------------------------- ;; Default POS rules for OOV ;; ---------------------------------------- ;; Template ;; Affix, POS, Features ;; All rules that apply will be used ;; Special rule with "affix" DEFAULT will be ;; used only if no others are used DEFAULT, N, =SING \A\d+\Z, NUM, =PLUR ;;transfer ;;get rid of the particle that indicates past tense ;;SWITCH ORDERS OF ADV VP -> (PP) (ADV) V PART NP (PP) V NP (ADV) ;;transfer ;;need to insert article 'the' NP -> N [DET,the] N ;;transfer ;;Switch orders of ADV ;;go school->go to school VP ->(PP) (ADV) (NEG) V (PART) NP (PP) (NEG) V [P,to] NP (ADV) =to ;;transfer ;;Switch orders of ADV ;;go school->go to school VP ->(PP) V NP (ADV) (PP) V [P,to] NP (ADV) =to ;;transfer ;;'do'-insertion in negatives ;;ADV IS ALREADY SWITCHED TO ENGLISH WORD ORDER,THIS IS AFTER THE 'TO' INSERTION IN THE ;;CASE WHERE IT APPLIED. IN DOING SO, ADV ORDER IS SWITCHED IN THE 'TO' INSERTION IN ;;SENTENCES WITHOUT THE NEG AS WELL. VP -> NEG V (P) NP (ADV) [AUX,do] NEG V (P) NP (ADV) =PRESENT ;;transfer ;;'do'-insertion in negatives, WITH ADV ORDER SWITCH. THIS IS THE CASE WHERE 'TO- ;;INSERTION' DOES NOT APPLY,THEREFORE HAS TO SWITCH IN THIS STEP IN THE CASE OF NEG. VP -> (ADV) NEG V (P) NP [AUX,do] NEG V (P) NP (ADV) =PRESENT ;;transfer ;;'did'-insertion in negatives VP -> NEG V (P) NP (ADV) [AUX,did] NEG V (P) NP (ADV) =PAST ;;transfer ;;'did'-insertion in negatives VP -> (ADV) NEG V (P) NP [AUX,did] NEG V (P) NP (ADV) =PAST ;;transfer ;;'does'-insertion in negatives VP -> NEG V (P) NP (ADV) [AUX,does] NEG V (P) NP (ADV) =PRESENT =3 ;;transfer ;;'does'-insertion in negatives VP -> (ADV) NEG V (P) NP [AUX,does] NEG V (P) NP (ADV) =PRESENT =3 ;;NP transfer rules NP -> (DET) (Q) CLAS (AP) N (DET) (Q) (AP) N ;;transfer rules: insert BE for non-verbal sentences S -> (ADV) NP AP (ADV) NP [V,am] AP =1 =SING =PRESENT S -> NP AP NP [V,am] AP =1 =SING ;;transfer rules: insert BE for non-verbal sentences S -> (ADV) NP AP (ADV) NP [V,is] AP =3 =SING =PRESENT S -> NP AP NP [V,is] AP =3 =SING ;;transfer rules: insert BE for non-verbal sentences S -> (ADV) NP AP (ADV) NP [V,are] AP =plural =PRESENT S -> NP AP NP [V,are] AP =plural S -> NP AP NP [V,are] AP =SING =2 ;;transfer rules: insert BE for non-verbal sentences S -> (ADV) NP AP (ADV) NP [V,was] AP =SING =PAST ;;transfer rules: insert BE for non-verbal sentences S -> (ADV) NP AP (ADV) NP [V,were] AP =plural =PAST ;;post processing ;; Capitalize first word of sentence \A(\W*)(\w) $1\u$2 ;;To be able to parse a period in the end of the sentence. ([\.\!\?])\s*\Z $1