carlosmendeznlp

Set up repository

Showing 126 changed files with 2174 additions and 0 deletions
How to run
$ bash $ISIMP/simplify.sh -json [INPUT] [OUTPUT]
You can place files anywhere and run the above commend. The INPUT file should contain plain text. The script will simplify the text and output the simplification constructs (with location information) in JSON format. For other usage, please try
$bash $ISIMP/simplify.sh -help
usage: Console [OPTIONS] [INPUT] [OUTPUT]
Tag the POS, parse the sentences, and detect simplification
constructs in the sentences.
By default, assume the document is not tokenized and
sentence-splited. Therefore, these two tasks will be done
first.
-help display this help and exit
-json print file in JSON format. If not set, print file in plain
text format
-parse_only If set, parse the document only
-tokenized set input tokenized. If not set, assume the document is not
tokenized and ssplited.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This file is too large to display.
No preview for this file type
// (VP) (CC) (VP NP) --> (VP CC VP) NP
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP <3 (VP=v2 <1 ~cc1=cc2 <2 NP|S=others) <- =v2
operation: move others $- p
// (VP) (CC) (VP NP) (...) --> (VP CC VP) NP (...)
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP=cc <3 (VP=v2 <1 ~cc1=cc2 <2 NP|S=others) !<- =v2
operation: move cc $- cc1, move cc2 $- cc, move c1 $+ others
tregex: VP=p <1 (VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP <3 (~cc1=c2) <4 NP=others <- =others
operation: move others $- p
//tregex: NP=p <1 NNS=nns <2 /,/ <3 NN=n1 <4 CC=cc <5 NN=n2
//operation: adjoinF (NP @) n1, move cc $- n1, move n2 $- cc
tregex: VP=p < (VBN|VBZ|VBD|VBP|VBG=cc1 $+ (CC|CONJP $+ (~cc1=c2)) !>1 =p)
operation: move others $- p
// apposition
// 33
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ !<<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ <<, DT|CD) !< CC <- =np2
// 22
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ !<<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ <<, DT) !< CC <- /,/
// 17
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ <<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ !<< DT) !< CC <- =np2
// 21
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ <<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ !<< DT) !< CC <- /,/
// 33
tregex: NP=p < (NP=np1 $++ (PP <1 (VBG < /including/) <2 NP=np2))
// 4
tregex: NP=p <1 (NP=np1 <1 CD) <2 /,/ <3 NP=np2 <4 /,/=end <- =end
// 3
tregex: NP=p <1 (NP=np1 << CD <2 (PP <<, /of/)) <2 /,/ <3 NP=np2
// NP(DT ...) NP(NN)
// 8
tregex: NP=p <1 (NP=np1 << DT) <2 (NP=np2 <: NN)
// the NP , a NP
tregex: NP=p <1 (NP=np1 <<, /the/) <2 /,/ <3 (NP=np2 <<, /^(a|an)_/)
// DT ... NNS NP(no CC)
// 4
tregex: NP=p <1 DT|JJ <-1 (NP=np2 !< CC !< /,/ $- NNS)
// DT NP(... NNS) NP
// 0
tregex: NP=p <1 DT|JJ <2 (NP <- NNS) <3 (NP=np2 !< CC !< /,/) <- =np2
// NP : NP
// 16
tregex: NP=p <1 NP=np1 <2 /:/ <3 (NP=np2 !<< CC !<< /,/) <- =np2
// NNS , NN CC NN
// apposition
// 33
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ !<<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ <<, DT|CD) !< CC <- =np2
// 22
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ !<<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ <<, DT) !< CC <- /,/
// 17
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ <<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ !<< DT) !< CC <- =np2
// 21
tregex: NP=p <1 (@/N.*/=np1 !<< /,/ <<, DT) <2 /,/ <3 (@/N.*/=np2 !<< /,/ !<< DT) !< CC <- /,/
// 33
tregex: NP=p < (NP=np1 $++ (PP <1 (VBG < /including/) <2 NP=np2))
// 4
tregex: NP=p <1 (NP=np1 <1 CD) <2 /,/ <3 NP=np2 <4 /,/=end <- =end
// 3
tregex: NP=p <1 (NP=np1 << CD <2 (PP <<, /of/)) <2 /,/ <3 NP=np2
operation: replace p np1
operation: replace p np2
// NP(DT ...) NP(NN)
// 8
tregex: NP=p <1 (NP=np1 << DT) <2 (NP=np2 <: NN)
operation: replace p np1
operation: replace p np2
// the NP , a NP
tregex: NP=p <1 (NP=np1 <<, /the/) <2 /,/ <3 (NP=np2 <<, /^(a|an)_/)
operation: replace p np1
operation: replace p np2
// DT ... NNS NP(no CC)
// 4
tregex: NP=p <1 DT|JJ <-1 (NP=np2 !< CC !< /,/ $- NNS)
operation: replace p np2
operation: prune np2
// DT NP(... NNS) NP
// 0
tregex: NP=p <1 DT|JJ <2 (NP <- NNS) <3 (NP=np2 !< CC !< /,/) <- =np2
operation: replace p np2
operation: prune np2
// NP : NP
// 16
tregex: NP=p <1 NP=np1 <2 /:/ <3 (NP=np2 !<< CC !<< /,/) <- =np2
operation: replace p np1
operation: replace p np2
// vbn coordination
tregex: VP=p < (VBN|VBZ|VBD|VBP|VBG|VB=cc1 $+ (CC|CONJP=cc $+ (~cc1=cc2)) !>1 =p)
operation: adjoinF (VP @) cc1, move cc $- cc1, move cc2 $- cc
tregex: VP=p < (VBN|VBZ|VBD|VBP|VBG|VB=cc1 $+ (CC|CONJP=cc $+ (~cc1=cc2 $+ __)))
operation: adjoinF (VP @) cc1, move cc $- cc1, move cc2 $- cc
// np , (np ... cc np)
tregex: NP=np <: NN|NNS=n1 $+ (/,/=comma $+ (NP <1 (NN|NNS=n2 $++ (CC [$+ NN|NNS | $+ (NP <: NN|NNS)] ))))
operation: move comma $+ n2, move n1 $+ comma, prune np
// NN , NN
tregex: NP=np <1 NN=nn1 <2 /,/ <3 NN=nn2 <- =nn2
operation: excise np np
// mrna
tregex: NP=p < ((NP=c1 <<- /mRNA/=mrna) $+ (CC=cc $+ (NP=c2 <<, /protein|surface/=protein)))
tregex: NP=p < ((NN=c2 <<: /surface/=protein) $+ (CC=cc $+ (NN=c1 <<: /mRNA/=mrna)))
tregex: NP=p < ((NP=c1 <<- /protein|surface/=protein) $+ (CC=cc $+ (NP=c2 <<, /mRNA/=mrna)))
// NP cc NP (mRNA)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 CC <3 (NP=c2 <1 __=nn <2 (NN <<: /mRNA/))
// NP , NP cc NP (mRNA)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 CC <5 (NP=c3 <1 __=nn <2 (NN <<: /mRNA/))
// NP , NP , cc NP (mRNA)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 CC <6 (NP==c3 <1 __=nn <2 (NN <<: /mRNA/))
// NP , NP , NP cc NP (mRNA)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 CC <7 (NP=c4 <1 __=nn <2 (NN <<: /mRNA/))
// NP , NP , NP , cc NP (mRNA)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 /,/ <7 CC <8 (NP=c4 <1 __=nn <2 (NN <<: /mRNA/))
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <- =c2
tregex: ADJP=n0 <1 (ADJP=c1 <1 (JJ=n2) <- =n2) <2 (CC=n3) <3 (ADJP=c2 <1 (JJ=n5) <- =n5) <- =c2
// 162
tregex: NP=n0 <1 (CC=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=c2 <1 (NN=n6) <- =n6) <- =c2
// 90
tregex: ADJP=n0 <1 (CC=n1) <2 (ADJP=c1 <1 (JJ=n3) <- =n3) <3 (CC=n4) <4 (ADJP=c2 <1 (JJ=n6) <- =n6) <- =c2
// 78
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (CC=n7) <6 (NP=c3 <1 (NN=n9) <- =n9) <- =c3
// CD CC CD
tregex: QP=n0 <1 (CD=c1) <2 (CC=n2) <3 (CD=c2) <- =c2
// PRP CC PRP
tregex: NP=n0 <1 (PRP=c1) <2 (CC=n2) <3 (PRP=c2) <- =c2
// DT NP:NN CC NP:NN
tregex: NP=n0 <1 (DT=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=c2 <1 (NN=n6) <- =n6) <- =c2
// NP:NNS CC NP:NNS
tregex: NP=n0 <1 (NP=c1 <1 (NNS=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NNS=n5) <- =n5) <- =c2
// NP:NN CC NP:NN
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NNS=n7) <- =n7) <- =n6
// 30
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=c2) <2 (NNS=n6) <- =n6) <- =n4
// 29
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (JJ=n5) <2 (NNS=n6) <- =n6) <- =c2
// 28
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NN=n3) <3 (NN=c1) <- =c1) <2 (CC=n5) <3 (NP=c2 <1 (NN=n7) <- =n7) <- =c2
// 27
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NN=n7) <- =n7) <- =n6
// 25
tregex: NP=n0 <1 (NP=c1 <1 (CD=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (CD=n5) <- =n5) <- =c2
// 24
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (NP=c3 <1 (NN=n8) <- =n8) <6 (/,/=n9) <7 (CC=n10) <8 (NP=c4 <1 (NN=n12) <- =n12) <- =c4
// 23
tregex: ADVP=n0 <1 (ADVP=c1 <1 (RB=n2) <- =n2) <2 (CC=n3) <3 (ADVP=c2 <1 (RB=n5) <- =n5) <- =c2
// 20
tregex: ADJP=n0 <1 (ADJP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (ADJP=c2 <1 (JJ=n5) <- =n5) <- =c2
// 20
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (CC=n6) <5 (NP=c3 <1 (NN=n8) <- =n8) <- =c3
// 21
tregex: NP=n0 <1 (NP=c1 <1 (JJ=n2) <2 (NN=n3) <- =n3) <2 (CC=n4) <3 (NP=c2 <1 (JJ=n6) <2 (NN=n7) <- =n7) <- =c2
// 17
tregex: NP=n0 <1 (NN=c1) <2 (CC=n2) <3 (NN=c2) <4 (NNS=n4) <- =n4
// 17
tregex: NP=n0 <1 (NP=c1 <1 (NNP=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NNP=n5) <- =n5) <- =c2
// 16
tregex: NP=n0 <1 (NP=c1 <1 (JJ=n2) <2 (NN=n3) <3 (NN=n4) <- =n4) <2 (CC=n5) <3 (NP=c2 <1 (NN=n7) <- =n7) <- =c2
// 16
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <2 (NN=n3) <3 (NN=n4) <- =n4) <2 (CC=n5) <3 (NP=c2 <1 (NN=n7) <2 (NN=n8) <3 (NN=n9) <- =n9) <- =c2
// 15
tregex: NP=n0 <1 (NNS=n1) <2 (CD=c1) <3 (CC=n3) <4 (CD=c2) <- =c2
// 13
tregex: NP=n0 <1 (NP=c1 <1 (NNS=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NN=n5) <2 (NNS=n6) <- =n6) <- =c2
// 13
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NNS=c1) <- =c1) <2 (CC=n4) <3 (NP=n5 <1 (NNS=c2) <- =c2) <- =c2
// 12
tregex: NP=n0 <1 (CC=n1) <2 (NP=n2 <1 (JJ=n3) <2 (NN=c1) <- =c1) <3 (CC=n5) <4 (NP=n6 <1 (NN=c2) <- =c2) <- =n6
// 11
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (CC=n7) <6 (NP=n8 <1 (NN=c3) <2 (NNS=n10) <- =n10) <- =n8
// 11
tregex: NP=n0 <1 (NP=c1 <1 (JJ=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=c2 <1 (JJ=n6) <2 (NNS=n7) <- =n7) <- =c2
// 11
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=c2 <1 (NN=n6) <2 (NNS=n7) <- =n7) <- =c2
// 11
tregex: NP=n0 <1 (NP=n1 <1 (JJ=n2) <2 (NNS=c1) <- =c1) <2 (CC=n4) <3 (NP=c2 <1 (NNS=n6) <- =n6) <- =c2
// 10
tregex: NP=n0 <1 (JJ=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=c2 <1 (NN=n6) <- =n6) <- =c2
// 10
tregex: NP=n0 <1 (CC=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (JJ=c2) <2 (NNS=n7) <- =n7) <- =n5
// 10
tregex: NP=n0 <1 (DT=n1) <2 (NN=c1) <3 (CC=n3) <4 (NN=c2) <5 (NNS=n5) <- =n5
// 10
tregex: NP=n0 <1 (CC=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=c2) <2 (NNS=n7) <- =n7) <- =n5
// 10
tregex: NP=n0 <1 (DT=n1) <2 (NP=c1 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=c2 <1 (NN=n6) <- =n6) <5 (NP=n7 <1 (NNS=n8) <- =n8) <- =n7
// 10
tregex: NP=n0 <1 (NP=c1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=c2 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NN=n7) <2 (NNS=n8) <- =n8) <- =n6
// 2 (DT NN CC NN)
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 (/NP|NN/=c1) <3 CC|CONJP=cc <4 (/NP|NN/=c2) <- =c2
tregex: NP=p <1 /CC|DT/ <2 JJ=c1 <3 CC=cc <4 JJ=c2
// 2 NN CC NN NNS: 17
tregex: NP=p <1 /NP|NN/=c1 <2 CC|CONJP=cc <3 (/NP|NN/=c2 !< PP) <4 __=end <- =end
tregex: NP=p <1 CC <2 /NP|NN/=c1 <3 CC|CONJP=cc <4 (/NP|NN/=c2 !< PP) <5 __=end <- =end
// 2 NN CC NN NN NN
tregex: NP=p <1 /NP|NN/=c1 <2 CC|CONJP=cc <3 /NP|NN/=c2 <4 /NP|NN/ <5 /NP|NN/=end <- =end
// 2 VBN NN CC NN NN: 12
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 /NP|NN/=c1 <3 CC|CONJP=cc <4 /NP|NN/=c2 <5 /NP|NN/ <6 /NP|NN/=end <- =end
// 2 DT NP CC NP NP
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 (/NP|NN/=c1) <3 CC|CONJP=cc <4 (/NP|NN/=c2) <5 (/NP|NN/=end) <- =end
// 2 NP CC NP NP: 92
tregex: NP <1 (NP=c1 <: NN) <2 CC|CONJP=cc <3 (NP=c2 <: NN) <4 NP=end <- =end
// 2 NN CD CC CD: 20
tregex: NP <2 (CD=c1) <3 CC|CONJP=cc <4 (CD=c2) <- =c2
// 2 CC DT NP CC NP NP
tregex: NP <1 (CC=cc1) <2 (DT) <3 (NP=c1 <: (NN)) <4 (CC=cc2) <5 (NP=c2 <: (NN)) <6 (NP=end <: (NNS)) <- =end
// 2 (JJ NN) CC NN
tregex: NP=p <1 (NP <1 JJ=jj <2 /NN|NNS/=c1 <- =c1) <2 CC|CONJP <3 (NP=c2 <: /NN|NNS/=nn2) <- =c2
// 2 NN NN CC NN: 129
tregex: NP=p <1 (NP <1 NN=jj <2 /NN|NNS/=c1 <- =c1) <2 CC|CONJP <3 (NP=c2 <: /NN|NNS/=nn2) <- =c2
// 2
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP <3 (VP=v2 <1 ~cc1=c2 <2 __=others) <- =v2
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP <3 (VP=v2 <1 ~cc1=c2)
// 2 NP CC NP PP
tregex: NP=p <1 (NP=c1 !< PP !<< /secretion/) <2 CC|CONJP=cc <3 (NP <1 NP=c2 <2 PP=pp <- =pp)
tregex: NP=p <1 (NP=c1 !< PP !<< /secretion/) <2 /,/ <3 CC|CONJP=cc <4 (NP <1 NP=c2 <2 PP=pp <- =pp)
tregex: NP=p <1 CC <2 (NP=c1 !< PP !<< /secretion/) <3 CC|CONJP=cc <4 (NP <1 NP=c2 <2 PP=pp <- =pp)
// 2 NN CC (NN NNS): 151
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 CC|CONJP <3 (NP=n2 <1 NN=c2 <2 NN|NNS=nns)
// 2 CC NN CC (NN NNS): 30
tregex: NP=p <1 (CC) <2 (NP=c1 <: /NN|NNS/=nn1) <3 CC|CONJP <4 (NP=n2 <1 /JJ|VBN|NN/=c2 <2 /NN|NNS/=nns) <- =n2
// 2 JJ CC NP(NN NNS)
tregex: NP=p <1 (NP <1 (ADJP=c1 <: (JJ=nn1))) <2 (CC) <3 (NP=n2 <1 (NN=c2) <2 (NNS=nns) <- =nns) <- =n2
// 2 NP(NN NN NN) CC NP(NN)
tregex: NP=p <1 (NP <1 (NN|DT|JJ) <2 (NN|JJ) <3 (NN=c1) <- =c1) <2 (CC) <3 (NP=c2 <: (NN=nn2)) <- =c2
// 2 NP(JJ NN NN) CC NP(NN NN)
tregex: NP=p <1 (NP=c1 <1 (JJ) <2 (NN=nn3) <3 (NN=nn1) <- =nn1) <2 (CC) <3 (NP=c2 <1 (NN=nn4) <2 (NN=nn2) <- =nn2) <- =c2
// 2 ADVP PP , CC PP
tregex: PP=p <1 ADVP <2 PP=c1 <3 /,/ <4 CC=cc <5 PP=c2 <- =c2
tregex: NP=p <1 (NP=c1 !<< DT) <2 /,/ <3 (NP=c2 !<< DT) <- =c2
tregex: VP=p <1 (VP=c1 << NP) <2 CC|CONJP <3 (VP=c2 <- NP)
tregex: NP=p <1 (NP=c1 <: NN) <2 CC|CONJP <3 (NP=c2 <1 DT)
//UCP=p <1 (ADJP=c1 <: (JJ)) <2 (CC) <3 (NP=c2 <: (NN)) <- =c2
tregex: NP=p <1 (CC) <2 (NP=c1 <1 (DT) <2 (NN)) <3 (CC) <4 (NP=c2 <1 (DT) <2 (NN) <3 (NN)) <- =c2
// 2 NP CC NP NP(NNS)
tregex: NP=p <1 NP=c1 <2 CC|CONJP=cc <3 NP=c2 <4 (NP <- NNS)
// 2 NP(NN) CC NP(JJ JJ NN)
tregex: NP=p <1 (NP=c1 <: (NN=nn1)) <2 (CC) <3 (NP=c2 <1 (JJ=jj1) <2 (JJ=jj2) <3 (NN=nn2) <- =nn2) <- =c2
// 2 NP(ADJP) CC NP(NN NNS)
tregex: NP=p <1 (NP=c1 <: (ADJP <: (JJ=nn1))) <2 (CC) <3 (NP=n2 <1 (NN=c2) <2 (NNS=nns) <- =nns) <- =n2
// 2 NN NN NP CC NP(NN)
tregex: NP=p <1 (NN) <2 (NN) <3 (NP=c1 <1 (NN)) <4 (CC=cc) <5 (NP=c2 <: (NN)) <- =c2
// 2 NN CC NN NN NN NN
tregex: NP=p <1 (NN=c1) <2 (CC=cc) <3 (NN=c2) <4 (NN) <5 (NN) <6 (NN)
// 3
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 /,/ <3 (VP=c2 <: ~cc1=cc2) <4 /,/ <5 CC|CONJP <6 (VP=v2 <1 ~cc1=c3 <2 __=others) <- =v2
//3 NN , NN , CC (NN NN): 19
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 CC|CONJP <5 (NP <1 NN=c3 <2 NNS=nn4 <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 CC|CONJP <6 (NP <1 NN=c3 <2 NNS=nn4 <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 CC|CONJP <5 (NP <1 NN=c3 <2 (NN=nn4 <<: /mRNA/) <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 CC|CONJP <6 (NP <1 NN=c3 <2 (NN=nn4 <<: /mRNA/) <- =nn4)
//3 NP , NP , CC NP NP: 5
tregex: NP <1 (NP=c1 <: NN) <2 /,/=comma1 <3 (NP=c2 <: NN) <4 /,/=comma2 <5 CC|CONJP=cc <6 (NP=c3 <: NN) <7 NP=end <- =end
//3 NN , NN , CC NN NN NNS: 2
tregex: NP <1 NN=c1 <2 /,/=comma1 <3 NN=c2 <4 /,/=comma2 <5 CC|CONJP=cc <6 NN=c3 <7 NN <8 /NNS/=end <- =end
// 3 NP(JJ NN) , NP , CC NP
tregex: NP=p <1 (NP=c1 <1 (JJ) <2 (NN=nn1)) <2 (/,/) <3 (NP <1 (NN=nn2)) <4 (/,/) <5 (CC) <6 (NP=c3 <1 (NN=nn3)) <- c3
// 4
tregex: NP=p <1 /NP|NN/=c1 <2 /,/=comma1 <3 /NP|NN/=c2 <4 /,/=comma2 <5 /NP|NN/=c3 <6 CC|CONJP=cc <7 /NP|NN/=c4 <8 /NP|NN/=end <- =end
// 4
tregex: NP=p <1 (NP=c1 <1 (NN) <2 (NN)) <2 (/,/) <3 (NP=c2 <1 (NN)) <4 (/,/) <5 (NP=c3 <1 (NN)) <6 (/,/) <7 (CC) <8 (NP=c4 <1 (NN)) <- =c4
//4 NN , NN , NN , CC NN NN: 4
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 CC|CONJP <7 (NP <1 NN=c4 <2 NNS=nn5 <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 /,/ <7 CC|CONJP <8 (NP <1 NN=c4 <2 NNS=nn5 <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 CC|CONJP <7 (NP <1 NN=c4 <2 (NN=nn5 <<: /mRNA/) <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 /,/ <7 CC|CONJP <8 (NP <1 NN=c4 <2 (NN=nn5 <<: /mRNA/) <- =nn5)
tregex: (NP=n6 <1 (NP=c1) <2 (/,/=n9) <3 (NP=c2) <4 (/,/=n12) <5 (NP=c3) <6 (/,/=n15) <7 (NP=c4) <8 (/,/=n18) <9 (NP=c5) <10 (/,/=n21) <11 (NP=c6) <- =c6)
tregex: (NP=n6 <1 (NP=c1) <2 (/,/=n9) <3 (NP=c2) <4 (/,/=n12) <5 (NP=c3) <6 (/,/=n15) <7 (NP=c4) <8 (/,/=n18) <9 (NP=c5) <- =c5)
tregex: (NP=n6 <1 (NP=c1) <2 (/,/=n9) <3 (NP=c2) <4 (/,/=n12) <5 (NP=c3) <6 (/,/=n15) <7 (NP=c4) <- =c4)
tregex: (NP=n6 <1 (NP=c1) <2 (/,/=n9) <3 (NP=c2) <4 (/,/=n12) <5 (NP=c3) <- =c3)
//1 PP ; PP ; PP cc PP
tregex: (PP=n6 <1 (PP=c1) <3 (PP=c2) <5 (PP=c3) <7 (PP=c4) <- =c4)
// mrna
tregex: NP=p < ((NP <<- /mRNA/=mrna) $+ (CC=cc $+ (NP <<, /protein|surface/=protein)))
tregex: NP=p < ((NN <<: /surface/=protein) $+ (CC=cc $+ (NN <<: /mRNA/=mrna)))
tregex: NP=p < ((NP <<- /protein|surface/=protein) $+ (CC=cc $+ (NP <<, /mRNA/=mrna)))
operation: prune mrna cc
operation: prune cc protein
// NP cc NP (mRNA)
tregex: NP=p <1 (NP <: NN=nn1) <2 CC <3 (NP=np2 <1 __=nn <2 (NN <<: /mRNA/))
operation: replace p np2
operation: replace nn nn1, replace p np2
// NP , NP cc NP (mRNA)
tregex: NP=p <1 (NP <: NN=nn1) <2 /,/ <3 (NP <: NN=nn2) <4 CC <5 (NP=np2 <1 __=nn <2 (NN <<: /mRNA/))
operation: replace p np2
operation: replace nn nn1, replace p np2
operation: replace nn nn2, replace p np2
// NP , NP , cc NP (mRNA)
tregex: NP=p <1 (NP <: NN=nn1) <2 /,/ <3 (NP <: NN=nn2) <4 /,/ <5 CC <6 (NP=np2 <1 __=nn <2 (NN <<: /mRNA/))
operation: replace p np2
operation: replace nn nn1, replace p np2
operation: replace nn nn2, replace p np2
// NP , NP , NP cc NP (mRNA)
tregex: NP=p <1 (NP <: NN=nn1) <2 /,/ <3 (NP <: NN=nn2) <4 /,/ <5 (NP <: NN=nn3) <6 CC <7 (NP=np2 <1 __=nn <2 (NN <<: /mRNA/))
operation: replace p np2
operation: replace nn nn1, replace p np2
operation: replace nn nn2, replace p np2
operation: replace nn nn3, replace p np2
// NP , NP , NP , cc NP (mRNA)
tregex: NP=p <1 (NP <: NN=nn1) <2 /,/ <3 (NP <: NN=nn2) <4 /,/ <5 (NP <: NN=nn3) <6 /,/ <7 CC <8 (NP=np2 <1 __=nn <2 (NN <<: /mRNA/))
operation: replace p np2
operation: replace nn nn1, replace p np2
operation: replace nn nn2, replace p np2
operation: replace nn nn3, replace p np2
// 892
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 308
tregex: ADJP=n0 <1 (ADJP=n1 <1 (JJ=n2) <- =n2) <2 (CC=n3) <3 (ADJP=n4 <1 (JJ=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 162
tregex: NP=n0 <1 (CC=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=n6) <- =n6) <- =n5
operation: replace n0 n2
operation: replace n0 n5
// 90
tregex: ADJP=n0 <1 (CC=n1) <2 (ADJP=n2 <1 (JJ=n3) <- =n3) <3 (CC=n4) <4 (ADJP=n5 <1 (JJ=n6) <- =n6) <- =n5
operation: replace n0 n2
operation: replace n0 n5
// 78
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (CC=n7) <6 (NP=n8 <1 (NN=n9) <- =n9) <- =n8
operation: replace n0 n1
operation: replace n0 n4
operation: replace n0 n8
// 77
tregex: QP=n0 <1 (CD=n1) <2 (CC=n2) <3 (CD=n3) <- =n3
operation: replace n0 n1
operation: replace n0 n3
// 68
tregex: NP=n0 <1 (DT=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=n6) <- =n6) <- =n5
operation: replace n0 n2
operation: replace n0 n5
// 47
tregex: NP=n0 <1 (NP=n1 <1 (NNS=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NNS=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 38
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NNS=n7) <- =n7) <- =n6
operation: prune n1 n3
operation: prune n3 n4
// 30
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <2 (NNS=n6) <- =n6) <- =n4
operation: replace n0 n4
operation: replace n5 n2, replace n0 n4
// 29
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (JJ=n5) <2 (NNS=n6) <- =n6) <- =n4
operation: replace n0 n4
operation: replace n5 n2, replace n0 n4
// 28
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NN=n3) <3 (NN=n4) <- =n4) <2 (CC=n5) <3 (NP=n6 <1 (NN=n7) <- =n7) <- =n6
operation: replace n0 n1
operation: replace n4 n7, replace n0 n1
// 27
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NN=n7) <- =n7) <- =n6
operation: prune n1 n3
operation: prune n3 n4
// 25
tregex: NP=n0 <1 (NP=n1 <1 (CD=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (CD=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 24
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (NP=n7 <1 (NN=n8) <- =n8) <6 (/,/=n9) <7 (CC=n10) <8 (NP=n11 <1 (NN=n12) <- =n12) <- =n11
operation: replace n0 n1
operation: replace n0 n4
operation: replace n0 n7
operation: replace n0 n11
// 23
tregex: ADVP=n0 <1 (ADVP=n1 <1 (RB=n2) <- =n2) <2 (CC=n3) <3 (ADVP=n4 <1 (RB=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 20
tregex: ADJP=n0 <1 (ADJP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (ADJP=n4 <1 (JJ=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 20
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (CC=n6) <5 (NP=n7 <1 (NN=n8) <- =n8) <- =n7
operation: replace n0 n1
operation: replace n0 n4
operation: replace n0 n7
// 21
tregex: NP=n0 <1 (NP=n1 <1 (JJ=n2) <2 (NN=n3) <- =n3) <2 (CC=n4) <3 (NP=n5 <1 (JJ=n6) <2 (NN=n7) <- =n7) <- =n5
operation: replace n0 n1
operation: replace n0 n4
// 17
tregex: NP=n0 <1 (NN=n1) <2 (CC=n2) <3 (NN=n3) <4 (NNS=n4) <- =n4
operation: prune n1 n2
operation: prune n2 n3
// 17
tregex: NP=n0 <1 (NP=n1 <1 (NNP=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NNP=n5) <- =n5) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 16
tregex: NP=n0 <1 (NP=n1 <1 (JJ=n2) <2 (NN=n3) <3 (NN=n4) <- =n4) <2 (CC=n5) <3 (NP=n6 <1 (NN=n7) <- =n7) <- =n6
operation: replace n0 n1
operation: replace n4 n7, replace n0 n1
// 16
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NN=n3) <3 (NN=n4) <- =n4) <2 (CC=n5) <3 (NP=n6 <1 (NN=n7) <2 (NN=n8) <3 (NN=n9) <- =n9) <- =n6
operation: replace n0 n1
operation: replace n0 n6
// 15
tregex: NP=n0 <1 (NNS=n1) <2 (CD=n2) <3 (CC=n3) <4 (CD=n4) <- =n4
operation: prune n2 n3
operation: prune n3 n4
// 13
tregex: NP=n0 <1 (NP=n1 <1 (NNS=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <2 (NNS=n6) <- =n6) <- =n4
operation: replace n0 n1
operation: replace n0 n4
// 13
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=n5 <1 (NNS=n6) <- =n6) <- =n5
operation: replace n0 n1
operation: replace n3 n6, replace n0 n1
// 12
tregex: NP=n0 <1 (CC=n1) <2 (NP=n2 <1 (JJ=n3) <2 (NN=n4) <- =n4) <3 (CC=n5) <4 (NP=n6 <1 (NN=n7) <- =n7) <- =n6
operation: replace n0 n2
operation: replace n4 n7, replace n0 n2
// 11
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (/,/=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (/,/=n6) <5 (CC=n7) <6 (NP=n8 <1 (NN=n9) <2 (NNS=n10) <- =n10) <- =n8
operation: replace n0 n8
operation: replace n9 n2, replace n0 n8
operation: replace n9 n5, replace n0 n8
// 11
tregex: NP=n0 <1 (NP=n1 <1 (JJ=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=n5 <1 (JJ=n6) <2 (NNS=n7) <- =n7) <- =n5
operation: replace n0 n1
operation: replace n0 n5
// 11
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=n5 <1 (NN=n6) <2 (NNS=n7) <- =n7) <- =n5
operation: replace n0 n1
operation: replace n0 n5
// 11
tregex: NP=n0 <1 (NP=n1 <1 (JJ=n2) <2 (NNS=n3) <- =n3) <2 (CC=n4) <3 (NP=n5 <1 (NNS=n6) <- =n6) <- =n5
operation: replace n0 n1
operation: replace n0 n5
// 10
tregex: NP=n0 <1 (JJ=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=n6) <- =n6) <- =n5
operation: prune n2 n4
operation: prune n4 n5
// 10
tregex: NP=n0 <1 (CC=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (JJ=n6) <2 (NNS=n7) <- =n7) <- =n5
operation: replace n0 n5
operation: replace n6 n3, replace n0 n5
// 10
tregex: NP=n0 <1 (DT=n1) <2 (NN=n2) <3 (CC=n3) <4 (NN=n4) <5 (NNS=n5) <- =n5
operation: prune n2 n3
operation: prune n3 n4
// 10
tregex: NP=n0 <1 (CC=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=n6) <2 (NNS=n7) <- =n7) <- =n5
operation: replace n0 n5
operation: replace n6 n2, replace n0 n5
// 10
tregex: NP=n0 <1 (DT=n1) <2 (NP=n2 <1 (NN=n3) <- =n3) <3 (CC=n4) <4 (NP=n5 <1 (NN=n6) <- =n6) <5 (NP=n7 <1 (NNS=n8) <- =n8) <- =n7
operation: prune n2 n4
operation: prune n4 n5
// 10
tregex: NP=n0 <1 (NP=n1 <1 (NN=n2) <- =n2) <2 (CC=n3) <3 (NP=n4 <1 (NN=n5) <- =n5) <4 (NP=n6 <1 (NN=n7) <2 (NNS=n8) <- =n8) <- =n6
operation: prune n1 n3
operation: prune n3 n4
// 2 (DT NN CC NN)
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 (/NP|NN/=c1) <3 CC|CONJP=cc <4 (/NP|NN/=c2) <- =c2
tregex: NP=p <1 /CC|DT/ <2 JJ=c1 <3 CC=cc <4 JJ=c2
// 2 NN CC NN NNS: 17
tregex: NP=p <1 /NP|NN/=c1 <2 CC|CONJP=cc <3 (/NP|NN/=c2 !< PP) <4 __=end <- =end
tregex: NP=p <1 CC <2 /NP|NN/=c1 <3 CC|CONJP=cc <4 (/NP|NN/=c2 !< PP) <5 __=end <- =end
// 2 NN CC NN NN NN
tregex: NP=p <1 /NP|NN/=c1 <2 CC|CONJP=cc <3 /NP|NN/=c2 <4 /NP|NN/ <5 /NP|NN/=end <- =end
// 2 VBN NN CC NN NN: 12
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 /NP|NN/=c1 <3 CC|CONJP=cc <4 /NP|NN/=c2 <5 /NP|NN/ <6 /NP|NN/=end <- =end
// 2 DT NP CC NP NP
tregex: NP=p <1 /CC|DT|JJ|VBN|PRP\$/ <2 (/NP|NN/=c1) <3 CC|CONJP=cc <4 (/NP|NN/=c2) <5 (/NP|NN/=end) <- =end
// 2 NP CC NP NP: 92
tregex: NP <1 (NP=c1 <: NN) <2 CC|CONJP=cc <3 (NP=c2 <: NN) <4 NP=end <- =end
// 2 NN CD CC CD: 20
tregex: NP <2 (CD=c1) <3 CC|CONJP=cc <4 (CD=c2) <- =c2
operation: prune cc c2
operation: prune cc c1
// 2 CC DT NP CC NP NP
tregex: NP <1 (CC=cc1) <2 (DT) <3 (NP=c1 <: (NN)) <4 (CC=cc2) <5 (NP=c2 <: (NN)) <6 (NP=end <: (NNS)) <- =end
operation: prune cc1 cc2 c2
operation: prune cc1 cc2 c1
// 2 (JJ NN) CC NN
tregex: NP=p <1 (NP=c1 <1 JJ=jj <2 /NN|NNS/=end <- =end) <2 CC|CONJP <3 (NP=c2 <: /NN|NNS/=nn2) <- =c2
// 2 NN NN CC NN: 129
tregex: NP=p <1 (NP=c1 <1 NN=jj <2 /NN|NNS/=end <- =end) <2 CC|CONJP <3 (NP=c2 <: /NN|NNS/=nn2) <- =c2
operation: replace p c1
operation: move jj $+ nn2, replace p c2
// 2
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 CC|CONJP <3 (VP=c2 <1 ~cc1 <2 __=others) <- =c2
operation: replace p c2
operation: move others $- cc1, replace p c1
// 2 NP CC NP PP
tregex: NP=p <1 (NP=c1 !< PP !<< /secretion/) <2 CC|CONJP=cc <3 (NP=c2 <2 PP=pp <- =pp)
tregex: NP=p <1 (NP=c1 !< PP !<< /secretion/) <2 /,/ <3 CC|CONJP=cc <4 (NP=c2 <2 PP=pp <- =pp)
tregex: NP=p <1 CC <2 (NP=c1 !< PP !<< /secretion/) <3 CC|CONJP=cc <4 (NP=c2 <2 PP=pp <- =pp)
operation: replace p c2
operation: prune cc, replace c2 pp
// 2 NN CC (NN NNS): 151
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 CC|CONJP <3 (NP=c2 <1 NN=nn2 <2 NN|NNS=nns)
// 2 CC NN CC (NN NNS): 30
tregex: NP=p <1 (CC) <2 (NP=c1 <: /NN|NNS/=nn1) <3 CC|CONJP <4 (NP=c2 <1 /JJ|VBN|NN/=nn2 <2 /NN|NNS/=nns) <- =c2
operation: replace p c2
operation: move nns $- nn1, replace p c1
operation: replace p c1
operation: replace p c2
// 2 JJ CC NP(NN NNS)
tregex: NP=p <1 (NP <1 (ADJP <: (JJ=nn1))) <2 (CC) <3 (NP=c2 <1 (NN=nn2) <2 (NNS=nns) <- =nns) <- =c2
operation: replace p c2
operation: replace nn2 nn1, replace p c2
// 2 NP(NN NN NN) CC NP(NN)
tregex: NP=p <1 (NP=c1 <1 (NN|DT|JJ) <2 (NN|JJ) <3 (NN=nn1) <- =nn1) <2 (CC) <3 (NP=c2 <: (NN=nn2)) <- =c2
operation: replace p c1
operation: replace nn1 nn2, replace p c1
// 2 NP(JJ NN NN) CC NP(NN NN)
tregex: NP=p <1 (NP=c1 <1 (JJ) <2 (NN=nn3) <3 (NN=nn1) <- =nn1) <2 (CC) <3 (NP=c2 <1 (NN=nn4) <2 (NN=nn2) <- =nn2) <- =c2
operation: replace p c1
operation: replace nn1 nn2, replace nn3 nn4, replace p c1
// 2 ADVP PP , CC PP
tregex: PP=p <1 ADVP <2 PP=c1 <3 /,/ <4 CC=cc <5 PP=c2 <- =c2
tregex: NP=p <1 (NP=c1 !<< DT) <2 /,/ <3 (NP=c2 !<< DT) <- =c2
tregex: VP=p <1 (VP=c1 << NP) <2 CC|CONJP <3 (VP=c2 <- NP)
tregex: NP=p <1 (NP=c1 <: NN) <2 CC|CONJP <3 (NP=c2 <1 DT)
//UCP=p <1 (ADJP=c1 <: (JJ)) <2 (CC) <3 (NP=c2 <: (NN)) <- =c2
tregex: NP=p <1 (CC) <2 (NP=c1 <1 (DT) <2 (NN)) <3 (CC) <4 (NP=c2 <1 (DT) <2 (NN) <3 (NN)) <- =c2
operation: replace p c1
operation: replace p c2
// 2 NP CC NP NP(NNS)
tregex: NP=p <1 NP=c1 <2 CC|CONJP=cc <3 NP=c2 <4 (NP <- NNS)
operation: prune c1 cc
operation: prune cc c2
// 2 NP(NN) CC NP(JJ JJ NN)
tregex: NP=p <1 (NP=c1 <: (NN=nn1)) <2 (CC) <3 (NP=c2 <1 (JJ=jj1) <2 (JJ=jj2) <3 (NN=nn2) <- =nn2) <- =c2
operation: replace p c2
operation: prune jj1, replace jj2 nn1, replace p c2
// 2 NP(ADJP) CC NP(NN NNS)
tregex: NP=p <1 (NP=c1 <: (ADJP <: (JJ=nn1))) <2 (CC) <3 (NP=c2 <1 (NN==jj1) <2 (NNS=nns) <- =nns) <- =c2
operation: replace p c2
operation: replace jj1 nn1, replace p c2
// 2 NN NN NP CC NP(NN)
tregex: NP=p <1 (NN) <2 (NN) <3 (NP=c1 <1 (NN)) <4 (CC=cc) <5 (NP=c2 <: (NN)) <- =c2
operation: prune c1 cc
operation: prune cc c2
// 2 NN CC NN NN NN NN
tregex: NP=p <1 (NN=c1) <2 (CC=cc) <3 (NN=c2) <4 (NN) <5 (NN) <6 (NN)
operation: prune c1 cc
operation: prune cc c2
// 2
tregex: NP=n0 <1 (NP=n1 <: NN) <2 CC=cc <3 (NP=n2 <: NN) <4 NN <5 NN
operation: prune n1 cc
operation: prune cc n2
// 2
tregex: NP=n0 <1 (NP=n1 <: NN) <2 CC=cc <3 NN=n2 <4 (NN <<, /mRNA/) <5 NN
operation: prune n1 cc
operation: prune cc n2
// 3
tregex: VP=p <1 (VP=c1 <: VBN|VBZ|VBD|VBP|VBG=cc1) <2 /,/ <3 (VP=c2 <: ~cc1=cc2) <4 /,/ <5 CC|CONJP <6 (VP=c3 <1 ~cc1 <2 __=others) <- =c3
operation: replace p c3
operation: move others $- cc1, replace p c1
operation: replace p c3
operation: move others $- cc2, replace p c2
//3 NN , NN , CC (NN NN): 19
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 CC|CONJP <5 (NP=c3 <1 NN=nn3 <2 NNS=nn4 <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 CC|CONJP <6 (NP=c3 <1 NN=nn3 <2 NNS=nn4 <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 CC|CONJP <5 (NP=c3 <1 NN=nn3 <2 (NN=nn4 <<: /mRNA/) <- =nn4)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 CC|CONJP <6 (NP=c3 <1 NN=nn3 <2 (NN=nn4 <<: /mRNA/) <- =nn4)
operation: replace p c3
operation: move nn4 $- nn1, replace p c1
operation: move nn4 $- nn2, replace p c2
//3 NP , NP , CC NP NP: 5
tregex: NP <1 (NP=c1 <: NN) <2 /,/=comma1 <3 (NP=c2 <: NN) <4 /,/=comma2 <5 CC|CONJP=cc <6 (NP=c3 <: NN) <7 NP=end <- =end
operation: prune c2 cc c3 comma1 comma2
operation: prune c1 cc c3 comma1 comma2
operation: prune c1 c2 cc comma1 comma2
//3 NN , NN , CC NN NN NNS: 2
tregex: NP <1 NN=c1 <2 /,/=comma1 <3 NN=c2 <4 /,/=comma2 <5 CC|CONJP=cc <6 NN=c3 <7 NN <8 /NNS/=end <- =end
operation: prune c2 cc c3 comma1 comma2
operation: prune c1 cc c3 comma1 comma2
operation: prune c1 c2 cc comma1 comma2
// 3 NP(JJ NN) , NP , CC NP
tregex: NP=p <1 (NP=c1 <1 (JJ) <2 (NN=nn1)) <2 (/,/) <3 (NP <1 (NN=nn2)) <4 (/,/) <5 (CC) <6 (NP=c3 <1 (NN=nn3)) <- c3
operation: replace p c1
operation: replace nn1 nn2, replace p c1
operation: replace nn1 nn3, replace p c1
// 4
tregex: NP=p <1 /NP|NN/=c1 <2 /,/=comma1 <3 /NP|NN/=c2 <4 /,/=comma2 <5 /NP|NN/=c3 <6 CC|CONJP=cc <7 /NP|NN/=c4 <8 /NP|NN/=end <- =end
operation: prune cc c1 c2 c3 comma1 comma2
operation: prune cc c2 c3 c4 comma1 comma2
operation: prune cc c3 c4 c1 comma1 comma2
operation: prune cc c4 c1 c2 comma1 comma2
// 4
tregex: NP=p <1 (NP=c1 <1 (NN) <2 (NN)) <2 (/,/) <3 (NP=c2 <1 (NN)) <4 (/,/) <5 (NP=c3 <1 (NN)) <6 (/,/) <7 (CC) <8 (NP=c4 <1 (NN)) <- =c4
operation: replace p c1
operation: replace p c2
operation: replace p c3
operation: replace p c4
//4 NN , NN , NN , CC NN NN: 4
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 CC|CONJP <7 (NP=c4 <1 NN=nn4 <2 NNS=nn5 <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 /,/ <7 CC|CONJP <8 (NP=c4 <1 NN=nn4 <2 NNS=nn5 <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 CC|CONJP <7 (NP=c4 <1 NN=nn4 <2 (NN=nn5 <<: /mRNA/) <- =nn5)
tregex: NP=p <1 (NP=c1 <: NN=nn1) <2 /,/ <3 (NP=c2 <: NN=nn2) <4 /,/ <5 (NP=c3 <: NN=nn3) <6 /,/ <7 CC|CONJP <8 (NP=c4 <1 NN=nn4 <2 (NN=nn5 <<: /mRNA/) <- =nn5)
operation: replace p c4
operation: move nn5 $- nn1, replace p c1
operation: move nn5 $- nn2, replace p c2
operation: move nn5 $- nn2, replace p c3
tregex: (NP=n6 <1 (NP=n7) <2 (/,/=n9) <3 (NP=n10) <4 (/,/=n12) <5 (NP=n13) <6 (/,/=n15) <7 (NP=n16) <8 (/,/=n18) <9 (NP=n19) <10 (/,/=n21) <11 (NP=n22) <- =n22)
operation: replace n6 n7
operation: replace n6 n10
operation: replace n6 n13
operation: replace n6 n16
operation: replace n6 n19
operation: replace n6 n22
tregex: (NP=n6 <1 (NP=n7) <2 (/,/=n9) <3 (NP=n10) <4 (/,/=n12) <5 (NP=n13) <6 (/,/=n15) <7 (NP=n16) <8 (/,/=n18) <9 (NP=n19) <- =n19)
operation: replace n6 n7
operation: replace n6 n10
operation: replace n6 n13
operation: replace n6 n16
operation: replace n6 n19
tregex: (NP=n6 <1 (NP=n7) <2 (/,/=n9) <3 (NP=n10) <4 (/,/=n12) <5 (NP=n13) <6 (/,/=n15) <7 (NP=n16) <- =n16)
operation: replace n6 n7
operation: replace n6 n10
operation: replace n6 n13
operation: replace n6 n16
tregex: (NP=n6 <1 (NP=n7) <2 (/,/=n9) <3 (NP=n10) <4 (/,/=n12) <5 (NP=n13) <- =n13)
operation: replace n6 n7
operation: replace n6 n10
operation: replace n6 n13
//1 PP ; PP ; PP cc PP
tregex: (PP=n6 <1 (PP=n7) <3 (PP=n10) <5 (PP=n12) <7 (PP=n13) <- =n13)
operation: replace n6 n7
operation: replace n6 n10
operation: replace n6 n12
operation: replace n6 n13
// identified NP as NP
tregex: __=p < (VP <1 (/^VB.?$/ <<: /^(identif)(y|ies|ied|ying)|(recogniz|determin)(e|es|ed|ing)?|(regard|consider|view|treat)(s|ed|ing)?|(think|thought)|(map)(s|ped|ping)?|(reveal)(s|ed|ing)?|(disclos)(e|es|ed|ing)?$/) <2 (NP=hype !< IN) <3 (PP <1 (IN <<: /as/) <2 NP=hypo))
tregex: __=p < (VP <1 (/^VB.?$/ <<: /^(identif)(y|ies|ied|ying)|(recogniz|determin)(e|es|ed|ing)?|(regard|consider|view|treat)(s|ed|ing)?|(think|thought)|(map)(s|ped|ping)?|(reveal)(s|ed|ing)?|(disclos)(e|es|ed|ing)?$/) <2 (NP <1 (NP=hype !< IN) <2 (PP <1 (IN <<: /as/) <2 NP=hypo)))
// identified NP , as NP
tregex: __=p < (VP <1 (/^VB.?$/ <<: /^(identif)(y|ies|ied|ying)|(recogniz|determin)(e|es|ed|ing)?|(regard|consider|view|treat)(s|ed|ing)?|(think|thought)|(map)(s|ped|ping)?|(reveal)(s|ed|ing)?|(disclos)(e|es|ed|ing)?$/) <2 (NP=hype !< IN) <3 /,/ <4 (PP <1 (IN <<: /as/) <2 NP=hypo))
// NP was identified as NP
tregex: S=p < (NP=hype $+ (VP <1 (/^VB.*$/ <<: /is|was|were|are/) <2 (VP <1 (/^VB.?$/ <<: /^identified|recognized|regarded|thought|mapped|revealed|known|disclosed$/) <2 (PP <1 (IN <<: /as/) <2 NP=hypo))))
tregex: S=p < (NP=hype $+ (VP <1 (/^VB.*$/ <<: /is|was|were|are/) <2 (VP <1 (/^VB.?$/ <<: /^identified|recognized|regarded|thought|mapped|revealed|known|disclosed$/) <2 (PP <1 (IN <<: /as/) <2 NP=hypo))))
// NP has been identified as NP
tregex: S=p < (NP=hype $+ (VP <1 (/^VB.*$/ <<: /has|had|have/) <2 (VP <1 (/^VB.*$/ <<: /been/) <2 (VP <1 (/^VB.?$/ <<: /^identified|recognized|regarded|thought|mapped|revealed|known|disclosed$/) <2 (PP <1 (IN <<: /as/) <2 NP=hypo)))))
tregex: S=p < (NP=hype $+ (VP <1 (/^VB.*$/ <<: /has|had|have/) <2 ADVP <3 (VP <1 (/^VB.*$/ <<: /been/) <2 (VP <1 (/^VB.?$/ <<: /^identified|recognized|regarded|thought|mapped|revealed|known|disclosed$/) <2 (PP <1 (IN <<: /as/) <2 NP=hypo)))))
// NP , termed NP
tregex: NP=p <1 (NP=hype) <2 /,/ <3 (VP <1 (/^VBN$/ <<: /^termed$/) <2 NP=hypo)
tregex: VP=p <1 (VP <<- NP=hype) <2 /,/ <3 (VP <1 (/^VBN$/ <<: /^termed$/) <2 NP=hypo)
// NP , known as NP
tregex: NP=p <1 (NP=hype) <2 /,/ <3 (VP <1 (/^VBN$/ <<: /^known$/) <2 (PP <1 (IN << /as/) <2 NP=hypo))
tregex: NP=p <1 (NP=hype) <2 PP <3 /,/ <4 (VP <1 (/^VBN$/ <<: /^known$/) <2 (PP <1 (IN << /as/) <2 NP=hypo))
// NP is a NP
tregex: S=p <1 NP=hype <2 (VP <1 (/^VB|VBZ|VBP$/ <<: /is|are/) <2 (NP=hypo <<, /^a|an$/))
tregex: S=p <1 NP=hype <2 (VP <-1 (VP <1 (/^VB|VBZ|VBP$/ <<: /is|are|be|been/) <2 (NP=hypo <<, /^a|an$/)))
// NP act|serves as NP
tregex: S=p < (NP=hype $+ (VP <1 (/^VB|VBZ|VBP|VBD$/ <<: /(act|serve)(s|d|ed)?/) <2 (PP <1 (IN << /as/) <2 NP=hypo)))
tregex: S=p < (NP=hype $+ (VP <1 (/^VB|VBZ|VBP|VBD$/ <<: /(act|serve)(s|d|ed)?/) <2 (SBAR <1 (IN << /as/) <2 S=hypo)))
tregex: S=p < (NP=hype $+ (VP <1 MD <2 (VP <1 (/^VB|VBZ|VBP|VBD$/ <<: /(act|serve)/) <2 (PP <1 (IN << /as/) <2 NP=hypo))))
// identification of NP as NP
tregex: NP=p <1 (NP <<- /(i|I)dentification/) <2 (PP <1 (IN << /of/) <2 (NP <1 NP=hype <2 (PP <1 (IN <<: /as/) <2 NP=hypo)))
tregex: __=p < (__ <<- (NP <1 (NP <<- /(i|I)dentification/) <2 (PP <1 (IN << /of/) <2 NP=hype)) $+ (PP <1 (IN <<: /as/) <2 NP=hypo))
// NP such as NP
tregex: __=p < (NP=tr $+ (PP <1 (JJ <: /such/) <2 (IN <: /as/) <3 NP=arg))
tregex: __=p < ((PP <1 IN <-1 NP=tr) $+ (PP <1 (JJ <: /such/) <2 (IN <: /as/) <3 NP=arg))
// NP , such as NP
tregex: __=p < (NP=tr $+ (/,/ $+ (PP <1 (JJ <: /such/) <2 (IN <: /as/) <3 NP=arg)))
tregex: __=p < (NP=tr $+ (/,/ $+ (ADJP <1 (JJ <: /such/) <2 (PP <1 (IN <: /as/) <2 NP=arg))))
tregex: __=p < (NP=tr $+ (/,/ $+ (ADJP <1 (JJ <: /such/) <2 (PP <1 (IN <: /as/) <2 NP=arg))))
tregex: __=p < (NP=tr $+ (/,/ $+ (CONJP <1 (JJ <: /such/) <2 (IN <: /as/) $+ (NP=arg))))
tregex: __=p < ((PP <1 IN <-1 NP=tr) $+ (/,/ $+ (PP <1 (JJ <: /such/) <2 (IN <: /as/) <3 NP=arg)))
tregex: __=p < ((VP <-1 (PP <-1 NP=tr)) $+ (/,/ $+ (PP <1 (JJ <: /such/) <2 (IN <: /as/) <3 NP=arg)))
// NP , including NP
tregex: __=p < (NP=tr $+ (/,/ $+ (PP <<, /including/ <2 NP=arg)))
tregex: __=p < ((VP <-1 (PP <-1 NP=tr)) $+ (/,/ $+ (PP <<, /including/ <2 NP=arg)))
tregex: __=p < ((VP <-1 NP=tr) $+ (/,/ $+ (PP <<, /including/ <2 NP=arg)))
tregex: __=p < ((VP <-1 NP=tr) $+ (/,/ $+ (VP <<, /including/ <2 NP=arg)))
tregex: __=p < ((PP <1 IN <-1 NP=tr) $+ (/,/ $+ (PP <<, /including/ <2 NP=arg)))
// NP including NP
tregex: __=p < (NP=tr $+ (PP <<, /including/ <2 NP=arg))
tregex: __=p < (NP=tr $+ (VP <<, /including/ <2 NP=arg))
tregex: __=p < ((PP <1 IN <-1 NP=tr) $+ (PP <<, /including/ <2 NP=arg))
tregex: __=p < (NP=tr $+ (/:/ $+ (S <1 (VP <<, /including/ <2 NP=arg))))
// NP which includes NP
tregex: __=p < (NP=tr $+ (SBAR <<, /which|that/ <2 (S <1 (VP <<, /include/ <2 NP=arg))))
// NP , which includes NP
tregex: __=p < (NP=tr $+ (/,/ $+ (SBAR <<, /which/ <2 (S <1 (VP <<, /include/ <2 NP=arg)))))
tregex: __=p < ((PP <1 IN <-1 NP=tr) $+ (/,/ $+ (SBAR <<, /which/ <2 (S <1 (VP <<, /include/ <2 NP=arg)))))
// classes of NP
tregex: NP=p <1 (NP=tr <<- /class|variety/ !< PP) <2 (PP <<, /of/ <2 (NP=arg !< PP))
tregex: NP=p <1 (NP=tr <<- /class|variety/ !< PP) <2 (PP <<, /of/ <2 (NP <1 NP=arg < PP))
tregex: /,/=comma $+ SBAR=sbar
operation: prune comma sbar
operation: new sbar
tregex: /,/=comma $+ /UCP/=ucp
operation: prune comma ucp
// (NP -LRB- __ -RRB-) --> (PRN -LRB- __ -RRB-)
tregex: NP=np <1 -LRB- <3 -RRB-=rrb <- =rrb
operation: relabel np PRN
// LRB is not the first child of the parent
tregex: -LRB-=lrb $+ (__=xx $+ -RRB-=rrb) !>1 __
operation: adjoinF (PRN @) lrb, move xx $- lrb, move rrb $- xx
// PRN is not the last child of the parent
tregex: PRN=prn !>- __ $- NP=np
operation: adjoinF (NP @) np, move prn $- np
// If the ref NP has PP, find the right most NP
tregex: PRN=prn $- (NP < PP <<- (NP=np !< PP))
operation: adjoinF (NP @) np, move prn $- np
// If the ref is VP, find the right most NP
tregex: PRN=prn $- (VP <<- (NP=np !< PP))
operation: adjoinF (NP @) np, move prn $- np
// NP (PRN L NP R)
tregex: /^NP/=n0 <1 (/^NP/=ref !< PP !< SBAR) <2 (PRN=n3 <1 (-LRB-=n4) <2 (/^NP|QP|ADJP|NN/=elements) <3 (-RRB-=n7) <- =n7) <- =n3
tregex: __=n0 < (/^ADJP|JJ/=ref $+ (PRN=n2 <1 (-LRB-=n3) <2 (/^NP/=elements) <3 (-RRB-=n5) <- =n5))
tregex: NP < (NN=n1 $+ (-LRB-=lrb $+ (NN=n2 $+ (NN=n3 $+ -RRB-=rrb))))
operation: prune lrb n2 n3 rrb
operation: prune n1 lrb rrb
tregex: NP=n0 <1 (NP=n1 !< PP) <2 (PRN=n3 <1 (-LRB-=n4) <2 (NP|QP|ADJP=n5) <3 (-RRB-=n7) <- =n7) <- =n3
operation: replace n0 n1
operation: replace n0 n5
tregex: ADJP=n0 <1 (JJ=n1) <2 (PRN=n2 <1 (-LRB-=n3) <2 (NP=n4) <3 (-RRB-=n6) <- =n6) <- =n2
operation: replace n2 n4
tregex: S=n0 <1 (PRN=n1 <1 (-LRB-=n2) <2 (NP=n3) <3 (-RRB-=n13) <- =n13) <- =n1
operation: prune n1
tregex: S=n0 <1 (-LRB-=n1) <2 (NP=n2) <3 (VP=n13) <4 (-RRB-=n25) <- =n25
operation: prune n0
operation: new n0
tregex: NP=n0 <1 (NN=n1) <2 (-LRB-=n2) <3 (CD=n3) <4 (-RRB-=n4) <- =n4
operation: prune n2 n4
operation: prune n2 n3 n4
tregex: __ < (@/N.*|JJ|CD/=n0 $+ (-LRB-=n1 $+ (__=n2 $+ -RRB-=n3)))
operation: prune n1 n2 n3
operation: prune n0 n1 n3
tregex: NP=n0 <1 (LST=n1 <1 (-LRB-=n2) <2 (LS=n3) <3 (-RRB-=n4) <- =n4)
operation: prune n1
tregex: VP=n0 <1 (VBN=n1) <2 (PRN=n2 <1 (-LRB-=n3) <2 (NP=n4) <3 (-RRB-=n6) <- =n6) <- =n2
operation: replace n2 n4
tregex: VP=n0 <1 (VBN=n1) <2 (ADVP=n2 <1 (RB=n3) <- =n3) <3 (PRN=n4 <1 (-LRB-=n5) <2 (NP=n6) <3 (-RRB-=n8) <- =n8) <- =n4
operation: replace n2 n6, prune n4
tregex: NP=n0 <1 (NP=n1 <1 (NP=n2) <2 (PP=n5 <1 (IN=n6) <2 (NP=n7) <- =n7) <- =n5) <2 (PRN=n11 <1 (-LRB-=n12) <2 (NP=n13) <3 (-RRB-=n15) <- =n15) <- =n11
operation: replace n0 n1
operation: replace n0 n13
operation: replace n7 n13, prune n11
tregex: __ < (ADJP|JJ=n0 $+ (PRN=n3 <1 (-LRB-=n4) <2 (__=n5) <3 (-RRB-=n7) <- =n7))
operation: replace n3 n5
tregex: __ < (NP|NN=n0 $+ (PRN=n3 <1 (-LRB-=n4) <2 (__=n5) <3 (-RRB-=n7) <- =n7))
operation: replace n0 n5
operation: prune n3
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n5 <1 (-LRB-=n6) <2 (NP=n7) <3 (/:/=n9) <4 (NP=n10) <5 (/,/=n13) <6 (NP=n14) <7 (-RRB-=n17) <- =n17) <- =n5
operation: replace n0 n1
operation: replace n0 n7
operation: replace n0 n10
operation: replace n0 n14
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n4 <1 (-LRB-=n5) <2 (NP=n6) <3 (/,/=n9) <4 (NP=n10) <5 (-RRB-=n13) <- =n13) <- =n4
operation: replace n0 n1
operation: replace n0 n6
operation: replace n0 n10
tregex: (PP=n0 <1 (IN=n1) <2 (NP=n2) <- =n2) $+ (PRN=n4 <1 (-LRB-=n5) <2 (NP=n6) <3 (-RRB-=n8) <- =n8)
operation: prune n4
operation: replace n2 n6, prune n4
tregex: NP=n0 <1 (-LRB-=n1) <2 (NP=n2) <3 (-RRB-=n6) <- =n6
operation: replace n0 n2
#tregex: __=n0 <1 (-LRB-=n1) <2 (__=n2) <3 (-RRB-=n3)
#operation: prune n1 n3
tregex: NP=n0 <1 (JJ=n1) <2 (-LRB-=n2) <3 (NN=n3) <4 (CD=n4) <5 (-RRB-=n5) <6 (JJ=n6) <7 (NN=n7) <8 (NN=n8) <- =n8
operation: prune n2 n5
tregex: ADJP=n0 <1 (ADJP=n1) <2 (PRN=n3 <1 (-LRB-=n4) <2 (NP=n5) <3 (/,/=n8) <4 (NP=n9) <5 (-RRB-=n12) <- =n12) <- =n3
operation: replace n3 n5
operation: replace n3 n9
tregex: NP=n0 <1 (NN=n1) <2 (NN=n2) <3 (JJ=n3) <4 (NN=n4) <5 (-LRB-=n5) <6 (NN=n6) <7 (NN=n7) <8 (-RRB-=n8) <9 (NN=n9) <- =n9
operation: prune n5 n8 n6 n7
operation: prune n4 n5 n8
tregex: NP=n0 <1 (NP=n1) <2 (NN=n7) <3 (-LRB-=n8) <4 (NN=n9) <5 (NN=n10) <6 (-RRB-=n11) <7 (NN=n12) <- =n12
operation: prune n8 n9 n10 n11
operation: prune n7 n8 n11
tregex: VP=n0 <1 (VBD=n1) <2 (ADVP=n2) <3 (PP=n4 <1 (IN=n5) <2 (NP=n6) <- =n6) <4 (PRN=n9 <1 (-LRB-=n10) <2 (NP=n11) <3 (/,/=n14) <4 (NP=n15) <5 (-RRB-=n21) <- =n21) <- =n9
operation: prune n9
operation: replace n6 n11, prune n9
operation: replace n6 n15, prune n9
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n5 <1 (-LRB-=n6) <2 (CC|CONJP=n7) <3 (ADVP=n8) <4 (NP=n10) <5 (-RRB-=n13) <- =n13) <- =n5
operation: replace n0 n1
operation: replace n0 n10
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n6 <1 (-LRB-=n7) <2 (PP=n8 <1 (FW=n9) <- =n9) <3 (/,/=n10) <4 (NP=n11) <5 (-RRB-=n18) <- =n18) <- =n6
operation: replace n0 n1
operation: replace n0 n11
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n4 <1 (-LRB-=n5) <2 (PP=n6 <1 (FW=n7) <2 (NP=n8) <- =n8) <3 (/,/=n10) <4 (NP=n11) <5 (-RRB-=n13) <- =n13) <- =n4
operation: replace n0 n1
operation: replace n0 n8
operation: replace n0 n11
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n3 <1 (-LRB-=n4) <2 (CC|CONJP=n5) <3 (NP=n6) <4 (-RRB-=n14) <- =n14) <- =n3
operation: replace n0 n1
operation: replace n0 n6
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n4 <1 (-LRB-=n5) <2 (NP=n6) <3 (/:/=n8) <4 (NP=n9) <5 (-RRB-=n11) <- =n11) <- =n4
operation: replace n0 n1
operation: replace n0 n6
operation: replace n0 n9
tregex: NP=n0 <1 (NP=n1) <2 (-LRB-=n7) <3 (CC|CONJP=n8) <4 (NP=n9) <5 (-RRB-=n16) <- =n16
operation: replace n0 n1
operation: replace n0 n9
tregex: NN=n1 $+ (-LRB-=n2 $+ (NN|JJ=n3 $+ (NN|CD=n4 $+ (-RRB-=n5))))
operation: prune n2 n3 n4 n5
operation: prune n1 n2 n5
tregex: NP=n0 <1 (NP=n1) <2 (-LRB-=n3) <3 (CC|CONJP=n4) <4 (NP=n5) <5 (-RRB-=n7) <- =n7
operation: replace n0 n1
operation: replace n0 n5
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n4 <1 (-LRB-=n5) <2 (NP=n6) <3 (PP=n8) <4 (-RRB-=n15) <- =n15) <- =n4
operation: replace n0 n1
operation: replace n1 n6, replace n4 n8
tregex: NN=n5 $+ (-LRB-=n6 $+ (NN=n7 $+ (/,/=n8 $+ (NN=n9 $+ -RRB-=n10))))
operation: prune n6 n7 n8 n9 n10
operation: prune n5 n6 n8 n9 n10
operation: prune n5 n6 n7 n8 n10
tregex: NP=n0 <1 (NP=n1) <2 (PRN=n4 <1 (-LRB-=n5) <2 (PP=n6 <1 (IN=n7 <: /for/) <2 (NP=n8 <1 (NN=n9 < /example/) <- =n9) <- =n8) <3 (/,/=n10) <4 (NP=n11 <1 (NP=n12) <2 (/,/=n14) <3 (NP=n15) <- =n15) <5 (-RRB-=n17) <- =n17) <- =n4
operation: replace n0 n1
operation: replace n0 n11
operation: replace n0 n15
// ref is pp
tregex: (PP <<- (NP=np !< PP)) $+ (SBAR=clause <1 (WHNP|WHPP|WHADVP) <2 (S <1 /^VP/=vp))
operation: adjoinF (NP @) np, move clause $- np
tregex: (PP <<- (NP=np !< PP)) $+ (/,/=comma $+ (SBAR=clause <1 (WHNP|WHPP|WHADVP) <2 (S <1 /^VP/=vp)))
operation: adjoinF (NP @) np, move comma $- np, move clause $- comma
// whnp relative clause
tregex: /^NP/=p < (/^NP/=ref $+ (/^SBAR/=clause <1 (WHNP) <2 (S <1 /^VP/=vp)))
tregex: /^NP/=p < (/^NP/=ref $+ (/^SBAR/=clause <1 (WHNP) <2 (S <1 PP|ADVP <2 /^VP/=vp)))
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 (WHNP) <2 (S <1 /^VP/=vp))))
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 (WHNP) <2 (S <1 PP|ADVP <2 /^VP/=vp))))
// only one case
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 (WHNP <<: /which/) <2 (S <1 /^NP/=vp))))
// wrb relative clause
tregex: /^NP/=p < (/^NP/=ref $+ (/^SBAR/=clause <1 WHADVP <2 S=s))
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 WHADVP <2 S=s)))
// whpp relative clause
tregex: /^NP/=p < (/^NP/=ref $+ (/^SBAR/=clause <1 (WHPP <1 IN=in) <2 (S <1 /^NP/)))
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 (WHPP <1 IN=in) <2 (S <1 /^NP/))))
// wp$ relative clause
tregex: /^NP/=p < (/^NP/=ref $+ (/,/ $+ (/^SBAR/=clause <1 /^WP[$]/ <2 S=s)))
// NP of NP
tregex: /^NP/=p < (/^NP/=ref1 $+ ((/^PP/ <1 IN <2 NP=ref) $+ (/^SBAR/=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 /^VP/=vp))))
tregex: /^NP/=p < (/^NP/=ref1 $+ ((/^PP/ <2 NP=ref2) $+ (/,/=comma $+ (/^SBAR/=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 /^VP/=vp)))))
tregex: /^NP/=p < (/^NP/=ref1 $+ (/,/ $+ (((/^VP/ <2 /^S|NP$/=ref2) $+ (/,/=comma $+ (/^SBAR/=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 /^VP/=vp)))))))
// NP of NP
tregex: /^NP/=p < (/^NP/=ref1 $+ ((PP <1 IN <2 NP=ref) $+ (/^SBAR/=clause <1 (WHNP <1 WDT) <2 (S <1 /^VP/=vp))))
tregex: /^NP/=p < (/^NP/=ref1 $+ ((PP <2 NP=ref) $+ (/,/=comma $+ (/^SBAR/=clause <1 (WHNP <1 WDT) <2 (S <1 /^VP/=vp)))))
tregex: /^NP/=p < (/^NP/=ref1 $+ (/,/ $+ (((/^VP/ <2 /^S|NP$/=ref) $+ (/,/=comma $+ (/^SBAR/=clause <1 (WHNP <1 WDT) <2 (S <1 /^VP/=vp)))))))
// as demenstrated ...
#tregex: /^NP/=p < (/^NP/=ref $+ (/^SBAR/=clause <1 (IN << /as/) <2 (S <1 /^VP/=vp)))
// reduced relative clause
tregex: /^NP/=p <1 /^NP/=ref <2 (/^VP/=clause <1 VBN|VBG)
tregex: /^NP/=p <1 /^NP/=ref <2 (/^PP/=clause <1 (VBG << /including/))
tregex: /^NP/=p <1 @/N.*/=ref <2 /,/ <3 (/^VP/=clause <1 VBN|VBG)
tregex: __=p < (/^NP/=ref $+ (/^VP/=clause <1 /^VBG/))
tregex: __=p < (/^NP/=ref $+ (/,/ $+ (/^S/ <: (/^VP/=clause <1 /^VBG/))))
#tregex: /^NP/=p <1 /^NP/=ref <2 VBN|VBG=clause
#tregex: __=p < (/,/=comma $+ (S=s <: (/^VP/=clause <1 (VBG) <2 (/^SBAR/ <2 S=s2))))
// whnp relative clause
// 16
tregex: NP=p < (NP=ref $+ (SBAR <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S=clause)))
operation: replace p ref
operation: replace wp ref, relabel whnp NP
// NP of NP
tregex: NP=p < (NP=ref1 $+ ((PP <1 IN <2 NP=ref2) $+ (SBAR=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 VP=vp))))
operation: prune clause
operation: replace wp ref1, relabel whnp NP
operation: replace wp ref2, relabel whnp NP
tregex: NP=p < (NP=ref1 $+ ((PP <2 NP=ref2) $+ (/,/=comma $+ (SBAR=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 VP=vp)))))
operation: prune clause comma
operation: replace wp ref1, relabel whnp NP
operation: replace wp ref2, relabel whnp NP
tregex: NP=p < (NP=ref1 $+ (/,/ $+ (((VP <2 /^S|NP$/=ref2) $+ (/,/=comma $+ (SBAR=clause <1 (WHNP=whnp <1 /WP\$/=wp <2 __=np) <2 (S <1 VP=vp)))))))
operation: prune clause comma
operation: replace wp ref1, relabel whnp NP
operation: replace wp ref2, relabel whnp NP
// wdt relative clause
// 154
tregex: NP=p < (NP=ref $+ (SBAR=clause <1 (WHNP <1 WDT) <2 (S <1 VP=vp)))
// 88
tregex: NP=p < (NP=ref $+ (/,/ $+ (SBAR=clause <1 (WHNP <1 WDT) <2 (S <1 VP=vp))))
operation: replace p ref
operation: new ref vp
// NP of NP
tregex: NP=p < (NP=ref1 $+ ((PP <1 IN <2 NP=ref2) $+ (SBAR=clause <1 (WHNP <1 WDT) <2 (S <1 VP=vp))))
operation: prune clause
operation: new ref1 vp
operation: new ref2 vp
tregex: NP=p < (NP=ref1 $+ ((PP <2 NP=ref2) $+ (/,/=comma $+ (SBAR=clause <1 (WHNP <1 WDT) <2 (S <1 VP=vp)))))
operation: prune clause comma
operation: new ref1 vp
operation: new ref2 vp
tregex: NP=p < (NP=ref1 $+ (/,/ $+ (((VP <2 /^S|NP$/=ref2) $+ (/,/=comma $+ (SBAR=clause <1 (WHNP <1 WDT) <2 (S <1 VP=vp)))))))
operation: prune clause comma
operation: new ref1 vp
operation: new ref2 vp
// wrb relative clause
// 4
tregex: NP=p < (NP=ref $+ (SBAR=clause <1 WHADVP <2 S=s))
// 4
tregex: NP=p < (NP=ref $+ (/,/ $+ (SBAR=clause <1 WHADVP <2 S=s)))
operation: replace p ref
operation: new s
// as demenstrated ...
// 6
tregex: NP=p < (NP=ref $+ (SBAR <1 (IN << /as/) <2 (S <1 VP=vp)))
operation: replace p ref
// whpp relative clause
// 18
tregex: NP=p < (NP=ref $+ (SBAR <1 (WHPP <1 IN=in) <2 (S=clause <1 NP)))
operation: replace p ref
operation: new clause in ref
// reduced relative clause
// 471
tregex: NP=p <1 NP=ref <2 (VP=vp <1 VBN|VBG)
// 23
tregex: NP=p <1 @/N.*/=ref <2 /,/ <3 (VP=vp <1 VBN|VBG)
// 1
tregex: NP=p <1 NP=ref <2 VBN|VBG=vp
operation: replace p ref
operation: new ref vp
tregex: __=p < (/,/=comma $+ (S=s <: (VP <1 (VBG) <2 (SBAR <2 S=s2))))
operation: prune comma s
operation: new s2
// When VBN, Theme
tregex: S <1 (SBAR=begin <1 WHADVP <2 (S <: (VP=tr))) <2 /,/=comma <3 (__ << NP=arg)
operation: new arg tr
operation: prune begin comma
tregex: S <1 (SBAR=begin <1 WHADVP <2 (S <: (VP=tr))) <2 (__ << NP=arg)
operation: new arg tr
operation: prune begin
// By VBG, Theme
tregex: S <1 (PP=begin <2 (S <: (VP=tr))) <2 /,/=comma <3 (NP=arg)
operation: new arg tr
operation: prune begin comma
tregex: S <1 (PP=begin <2 (S <: (VP=tr))) <2 (NP=arg)
operation: new arg tr
operation: prune begin
#!/bin/bash
for f in /home/cmendezc/isimp_v2/inputFiles/*; do
oFile="${f/input/output}"
echo $oFile
bash simplify.sh $f "${oFile/.txt/.isimp.txt}"
done
#!/bin/sh -x
#!/bin/sh
# Might fail if $0 is a link
TAGGER_HOME=`dirname "$0"`
CLASSPATH="$TAGGER_HOME/lib/*:$TAGGER_HOME/bin"
OUTPUT_DIR="$TAGGER_HOME/bin"
SRC_DIR="$TAGGER_HOME/src"
# get java
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
JAVACMD="$JAVA_HOME/bin/java"
else
JAVACMD="`which java`"
fi
fi
$JAVACMD -Xmx1024m -classpath $CLASSPATH:$OUTPUT_DIR main.Console $@
{
"TYPE": "sentence",
"TEXT": "The B cell-associated surface molecule CD40 functions to regulate B cell responses.",
"FROM": 0,
"TO ": 83,
"POS ": "The_DT B_NN cell-associated_JJ surface_NN molecule_NN CD40_NN functions_VBZ to_TO regulate_VB B_NN cell_NN responses_NNS ._. ",
"TREE": "(ROOT (S (NP (DT The) (NN B) (JJ cell-associated) (NN surface) (NN molecule) (NN CD40)) (VP (VBZ functions) (S (VP (TO to) (VP (VB regulate) (NP (NN B) (NN cell) (NNS responses)))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Cross-linking CD40 on B cells can lead to homotypic cell adhesion, IL-6 production, and, in combination with cytokines, to Ig isotype switching.",
"FROM": 84,
"TO ": 228,
"POS ": "Cross-linking_NN CD40_NN on_IN B_NN cells_NNS can_MD lead_VB to_TO homotypic_JJ cell_NN adhesion_NN ,_, IL-6_NN production_NN ,_, and_CC ,_, in_IN combination_NN with_IN cytokines_NNS ,_, to_TO Ig_NN isotype_NN switching_NN ._. ",
"TREE": "(ROOT (S (NP (NP (NN Cross-linking) (NN CD40)) (PP (IN on) (NP (NN B) (NNS cells)))) (VP (MD can) (VP (VB lead) (PP (PP (TO to) (NP (NP (JJ homotypic) (NN cell) (NN adhesion)) (, ,) (NP (NN IL-6) (NN production)) (, ,))) (CC and) (PRN (, ,) (PP (IN in) (NP (NP (NN combination)) (PP (IN with) (NP (NNS cytokines))))) (, ,)) (PP (TO to) (NP (NN Ig) (NN isotype) (NN switching)))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Tyrosine kinase activity is increased shortly after engagement of this receptor.",
"FROM": 229,
"TO ": 309,
"POS ": "Tyrosine_NN kinase_NN activity_NN is_VBZ increased_VBN shortly_RB after_IN engagement_NN of_IN this_DT receptor_NN ._. ",
"TREE": "(ROOT (S (NP (NN Tyrosine) (NN kinase) (NN activity)) (VP (VBZ is) (VP (VBN increased) (ADVP (RB shortly)) (PP (IN after) (NP (NP (NN engagement)) (PP (IN of) (NP (DT this) (NN receptor))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Little is known about how the very early events induced by CD40 cross-linking link to cellular responses.",
"FROM": 310,
"TO ": 415,
"POS ": "Little_JJ is_VBZ known_VBN about_IN how_WRB the_DT very_RB early_JJ events_NNS induced_VBN by_IN CD40_NN cross-linking_NN link_NN to_TO cellular_JJ responses_NNS ._. ",
"TREE": "(ROOT (S (NP (JJ Little)) (VP (VBZ is) (VP (VBN known) (PP (IN about) (SBAR (WHADVP (WRB how)) (S (NP (DT the) (ADJP (RB very) (JJ early)) (NNS events)) (VP (VBN induced) (PP (IN by) (NP (NP (NN CD40) (NN cross-linking) (NN link)) (PP (TO to) (NP (JJ cellular) (NNS responses))))))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "In this study, we demonstrate that nuclear factor (NF)-kappa B and NF-kappa B-like transcription factors are activated after cross-linking CD40 on resting human tonsillar B cells and on B cell lines.",
"FROM": 416,
"TO ": 615,
"POS ": "In_IN this_DT study_NN ,_, we_PRP demonstrate_VBP that_IN nuclear_JJ factor_NN -LRB-_-LRB- NF_NN -RRB-_-RRB- -_: kappa_NN B_NN and_CC NF-kappa_NN B-like_JJ transcription_NN factors_NNS are_VBP activated_VBN after_IN cross-linking_JJ CD40_NN on_IN resting_VBG human_JJ tonsillar_JJ B_NN cells_NNS and_CC on_IN B_NN cell_NN lines_NNS ._. ",
"TREE": "(ROOT (S (PP (IN In) (NP (DT this) (NN study))) (, ,) (NP (PRP we)) (VP (VBP demonstrate) (SBAR (IN that) (S (NP (NP (JJ nuclear) (NN factor)) (PRN (-LRB- -LRB-) (NP (NN NF)) (-RRB- -RRB-))) (: -) (NP (NP (NN kappa) (NN B)) (CC and) (NP (NN NF-kappa) (JJ B-like) (NN transcription) (NNS factors))) (VP (VBP are) (VP (VBN activated) (PP (IN after) (NP (JJ cross-linking) (NN CD40))) (PP (PP (IN on) (S (VP (VBG resting) (NP (JJ human) (JJ tonsillar) (NN B) (NNS cells))))) (CC and) (PP (IN on) (NP (NN B) (NN cell) (NNS lines))))))))) (. .)))",
"SIMP": [
{
"TYPE": "parenthesis",
"TEXT": "nuclear factor (NF",
"FROM": 451,
"TO ": 469,
"COMP": [
{
"TYPE": "referred noun phrase",
"FROM": 451,
"TO ": 465
},
{
"TYPE": "parenthesized elements",
"FROM": 467,
"TO ": 469
}
]
},
{
"TYPE": "noun or noun phrase coordination",
"TEXT": "kappa B and NF-kappa B-like transcription factors",
"FROM": 471,
"TO ": 520,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 471,
"TO ": 478
},
{
"TYPE": "conjunction",
"FROM": 479,
"TO ": 482
},
{
"TYPE": "conjunct",
"FROM": 483,
"TO ": 520
}
]
},
{
"TYPE": "prep or prep phrase coordination",
"TEXT": "on resting human tonsillar B cells and on B cell lines",
"FROM": 560,
"TO ": 614,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 560,
"TO ": 594
},
{
"TYPE": "conjunction",
"FROM": 595,
"TO ": 598
},
{
"TYPE": "conjunct",
"FROM": 599,
"TO ": 614
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "The activation is rapid and is mediated through a tyrosine kinase-dependent pathway.",
"FROM": 616,
"TO ": 700,
"POS ": "The_DT activation_NN is_VBZ rapid_JJ and_CC is_VBZ mediated_VBN through_IN a_DT tyrosine_NN kinase-dependent_JJ pathway_NN ._. ",
"TREE": "(ROOT (S (NP (DT The) (NN activation)) (VP (VP (VBZ is) (ADJP (JJ rapid))) (CC and) (VP (VBZ is) (VP (VBN mediated) (PP (IN through) (NP (DT a) (NN tyrosine) (JJ kinase-dependent) (NN pathway)))))) (. .)))",
"SIMP": [
{
"TYPE": "verb or verb phrase coordination",
"TEXT": "is rapid and is mediated through a tyrosine kinase-dependent pathway",
"FROM": 631,
"TO ": 699,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 631,
"TO ": 639
},
{
"TYPE": "conjunction",
"FROM": 640,
"TO ": 643
},
{
"TYPE": "conjunct",
"FROM": 644,
"TO ": 699
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "The complexes detected in electrophoretic mobility shift assays contain p50, p65 (RelA), c-Rel, and most likely other components.",
"FROM": 701,
"TO ": 830,
"POS ": "The_DT complexes_NNS detected_VBN in_IN electrophoretic_JJ mobility_NN shift_NN assays_NNS contain_VBP p50_NN ,_, p65_NN -LRB-_-LRB- RelA_NN -RRB-_-RRB- ,_, c-Rel_NN ,_, and_CC most_RBS likely_JJ other_JJ components_NNS ._. ",
"TREE": "(ROOT (S (NP (NP (DT The) (NNS complexes)) (VP (VBN detected) (PP (IN in) (NP (JJ electrophoretic) (NN mobility) (NN shift) (NNS assays))))) (VP (VBP contain) (NP (NP (NN p50) (, ,) (NN p65) (PRN (-LRB- -LRB-) (NN RelA) (-RRB- -RRB-))) (, ,) (NP (NN c-Rel)) (, ,) (CC and) (NP (ADJP (RBS most) (JJ likely)) (JJ other) (NNS components)))) (. .)))",
"SIMP": [
{
"TYPE": "reduced relative clause",
"TEXT": "The complexes detected in electrophoretic mobility shift assays",
"FROM": 701,
"TO ": 764,
"COMP": [
{
"TYPE": "referred noun phrase",
"FROM": 701,
"TO ": 714
},
{
"TYPE": "clause",
"FROM": 715,
"TO ": 764
}
]
},
{
"TYPE": "noun or noun phrase coordination",
"TEXT": "p50, p65 (RelA), c-Rel, and most likely other components",
"FROM": 773,
"TO ": 829,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 773,
"TO ": 788
},
{
"TYPE": "conjunct",
"FROM": 790,
"TO ": 795
},
{
"TYPE": "conjunction",
"FROM": 797,
"TO ": 800
},
{
"TYPE": "conjunct",
"FROM": 801,
"TO ": 829
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "By using transient transfection assays, we found that cross-linking CD40 supports NF-kappa B-dependent gene expression.",
"FROM": 831,
"TO ": 950,
"POS ": "By_IN using_VBG transient_JJ transfection_NN assays_NNS ,_, we_PRP found_VBD that_IN cross-linking_JJ CD40_NN supports_VBZ NF-kappa_NN B-dependent_JJ gene_NN expression_NN ._. ",
"TREE": "(ROOT (S (PP (IN By) (S (VP (VBG using) (NP (JJ transient) (NN transfection) (NNS assays))))) (, ,) (NP (PRP we)) (VP (VBD found) (SBAR (IN that) (S (NP (JJ cross-linking) (NN CD40)) (VP (VBZ supports) (NP (NP (NN NF-kappa)) (NP (JJ B-dependent) (NN gene) (NN expression))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Our results define the NF-kappa B system as an intermediate event in CD40 signaling and suggest that the CD40 pathway can influence the expression of B cell-associated genes with NF-kappa B consensus sites.",
"FROM": 951,
"TO ": 1157,
"POS ": "Our_PRP$ results_NNS define_VBP the_DT NF-kappa_NN B_NN system_NN as_IN an_DT intermediate_JJ event_NN in_IN CD40_NN signaling_NN and_CC suggest_VBP that_IN the_DT CD40_NN pathway_NN can_MD influence_VB the_DT expression_NN of_IN B_NN cell-associated_JJ genes_NNS with_IN NF-kappa_NN B_NN consensus_NN sites_NNS ._. ",
"TREE": "(ROOT (S (NP (PRP$ Our) (NNS results)) (VP (VP (VBP define) (NP (DT the) (NN NF-kappa) (NN B) (NN system)) (PP (IN as) (NP (NP (DT an) (JJ intermediate) (NN event)) (PP (IN in) (NP (NN CD40) (NN signaling)))))) (CC and) (VP (VBP suggest) (SBAR (IN that) (S (NP (DT the) (NN CD40) (NN pathway)) (VP (MD can) (VP (VB influence) (NP (NP (DT the) (NN expression)) (PP (IN of) (NP (NN B) (JJ cell-associated) (NNS genes)))) (PP (IN with) (NP (NN NF-kappa) (NN B) (NN consensus) (NNS sites))))))))) (. .)))",
"SIMP": [
{
"TYPE": "verb or verb phrase coordination",
"TEXT": "define the NF-kappa B system as an intermediate event in CD40 signaling and suggest that the CD40 pathway can influence the expression of B cell-associated genes with NF-kappa B consensus sites",
"FROM": 963,
"TO ": 1156,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 963,
"TO ": 1034
},
{
"TYPE": "conjunction",
"FROM": 1035,
"TO ": 1038
},
{
"TYPE": "conjunct",
"FROM": 1039,
"TO ": 1156
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "The B cell-associated surface molecule CD40 functions to regulate B cell responses.",
"FROM": 0,
"TO ": 83,
"POS ": "The_DT B_NN cell-associated_JJ surface_NN molecule_NN CD40_NN functions_VBZ to_TO regulate_VB B_NN cell_NN responses_NNS ._. ",
"TREE": "(ROOT (S (NP (DT The) (NN B) (JJ cell-associated) (NN surface) (NN molecule) (NN CD40)) (VP (VBZ functions) (S (VP (TO to) (VP (VB regulate) (NP (NN B) (NN cell) (NNS responses)))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Cross-linking CD40 on B cells can lead to homotypic cell adhesion, IL-6 production, and, in combination with cytokines, to Ig isotype switching.",
"FROM": 84,
"TO ": 228,
"POS ": "Cross-linking_NN CD40_NN on_IN B_NN cells_NNS can_MD lead_VB to_TO homotypic_JJ cell_NN adhesion_NN ,_, IL-6_NN production_NN ,_, and_CC ,_, in_IN combination_NN with_IN cytokines_NNS ,_, to_TO Ig_NN isotype_NN switching_NN ._. ",
"TREE": "(ROOT (S (NP (NP (NN Cross-linking) (NN CD40)) (PP (IN on) (NP (NN B) (NNS cells)))) (VP (MD can) (VP (VB lead) (PP (PP (TO to) (NP (NP (JJ homotypic) (NN cell) (NN adhesion)) (, ,) (NP (NN IL-6) (NN production)) (, ,))) (CC and) (PRN (, ,) (PP (IN in) (NP (NP (NN combination)) (PP (IN with) (NP (NNS cytokines))))) (, ,)) (PP (TO to) (NP (NN Ig) (NN isotype) (NN switching)))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Tyrosine kinase activity is increased shortly after engagement of this receptor.",
"FROM": 229,
"TO ": 309,
"POS ": "Tyrosine_NN kinase_NN activity_NN is_VBZ increased_VBN shortly_RB after_IN engagement_NN of_IN this_DT receptor_NN ._. ",
"TREE": "(ROOT (S (NP (NN Tyrosine) (NN kinase) (NN activity)) (VP (VBZ is) (VP (VBN increased) (ADVP (RB shortly)) (PP (IN after) (NP (NP (NN engagement)) (PP (IN of) (NP (DT this) (NN receptor))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Little is known about how the very early events induced by CD40 cross-linking link to cellular responses.",
"FROM": 310,
"TO ": 415,
"POS ": "Little_JJ is_VBZ known_VBN about_IN how_WRB the_DT very_RB early_JJ events_NNS induced_VBN by_IN CD40_NN cross-linking_NN link_NN to_TO cellular_JJ responses_NNS ._. ",
"TREE": "(ROOT (S (NP (JJ Little)) (VP (VBZ is) (VP (VBN known) (PP (IN about) (SBAR (WHADVP (WRB how)) (S (NP (DT the) (ADJP (RB very) (JJ early)) (NNS events)) (VP (VBN induced) (PP (IN by) (NP (NP (NN CD40) (NN cross-linking) (NN link)) (PP (TO to) (NP (JJ cellular) (NNS responses))))))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "In this study, we demonstrate that nuclear factor (NF)-kappa B and NF-kappa B-like transcription factors are activated after cross-linking CD40 on resting human tonsillar B cells and on B cell lines.",
"FROM": 416,
"TO ": 615,
"POS ": "In_IN this_DT study_NN ,_, we_PRP demonstrate_VBP that_IN nuclear_JJ factor_NN -LRB-_-LRB- NF_NN -RRB-_-RRB- -_: kappa_NN B_NN and_CC NF-kappa_NN B-like_JJ transcription_NN factors_NNS are_VBP activated_VBN after_IN cross-linking_JJ CD40_NN on_IN resting_VBG human_JJ tonsillar_JJ B_NN cells_NNS and_CC on_IN B_NN cell_NN lines_NNS ._. ",
"TREE": "(ROOT (S (PP (IN In) (NP (DT this) (NN study))) (, ,) (NP (PRP we)) (VP (VBP demonstrate) (SBAR (IN that) (S (NP (NP (JJ nuclear) (NN factor)) (PRN (-LRB- -LRB-) (NP (NN NF)) (-RRB- -RRB-))) (: -) (NP (NP (NN kappa) (NN B)) (CC and) (NP (NN NF-kappa) (JJ B-like) (NN transcription) (NNS factors))) (VP (VBP are) (VP (VBN activated) (PP (IN after) (NP (JJ cross-linking) (NN CD40))) (PP (PP (IN on) (S (VP (VBG resting) (NP (JJ human) (JJ tonsillar) (NN B) (NNS cells))))) (CC and) (PP (IN on) (NP (NN B) (NN cell) (NNS lines))))))))) (. .)))",
"SIMP": [
{
"TYPE": "parenthesis",
"TEXT": "nuclear factor (NF",
"FROM": 451,
"TO ": 469,
"COMP": [
{
"TYPE": "referred noun phrase",
"FROM": 451,
"TO ": 465
},
{
"TYPE": "parenthesized elements",
"FROM": 467,
"TO ": 469
}
]
},
{
"TYPE": "noun or noun phrase coordination",
"TEXT": "kappa B and NF-kappa B-like transcription factors",
"FROM": 471,
"TO ": 520,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 471,
"TO ": 478
},
{
"TYPE": "conjunction",
"FROM": 479,
"TO ": 482
},
{
"TYPE": "conjunct",
"FROM": 483,
"TO ": 520
}
]
},
{
"TYPE": "prep or prep phrase coordination",
"TEXT": "on resting human tonsillar B cells and on B cell lines",
"FROM": 560,
"TO ": 614,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 560,
"TO ": 594
},
{
"TYPE": "conjunction",
"FROM": 595,
"TO ": 598
},
{
"TYPE": "conjunct",
"FROM": 599,
"TO ": 614
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "The activation is rapid and is mediated through a tyrosine kinase-dependent pathway.",
"FROM": 616,
"TO ": 700,
"POS ": "The_DT activation_NN is_VBZ rapid_JJ and_CC is_VBZ mediated_VBN through_IN a_DT tyrosine_NN kinase-dependent_JJ pathway_NN ._. ",
"TREE": "(ROOT (S (NP (DT The) (NN activation)) (VP (VP (VBZ is) (ADJP (JJ rapid))) (CC and) (VP (VBZ is) (VP (VBN mediated) (PP (IN through) (NP (DT a) (NN tyrosine) (JJ kinase-dependent) (NN pathway)))))) (. .)))",
"SIMP": [
{
"TYPE": "verb or verb phrase coordination",
"TEXT": "is rapid and is mediated through a tyrosine kinase-dependent pathway",
"FROM": 631,
"TO ": 699,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 631,
"TO ": 639
},
{
"TYPE": "conjunction",
"FROM": 640,
"TO ": 643
},
{
"TYPE": "conjunct",
"FROM": 644,
"TO ": 699
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "The complexes detected in electrophoretic mobility shift assays contain p50, p65 (RelA), c-Rel, and most likely other components.",
"FROM": 701,
"TO ": 830,
"POS ": "The_DT complexes_NNS detected_VBN in_IN electrophoretic_JJ mobility_NN shift_NN assays_NNS contain_VBP p50_NN ,_, p65_NN -LRB-_-LRB- RelA_NN -RRB-_-RRB- ,_, c-Rel_NN ,_, and_CC most_RBS likely_JJ other_JJ components_NNS ._. ",
"TREE": "(ROOT (S (NP (NP (DT The) (NNS complexes)) (VP (VBN detected) (PP (IN in) (NP (JJ electrophoretic) (NN mobility) (NN shift) (NNS assays))))) (VP (VBP contain) (NP (NP (NN p50) (, ,) (NN p65) (PRN (-LRB- -LRB-) (NN RelA) (-RRB- -RRB-))) (, ,) (NP (NN c-Rel)) (, ,) (CC and) (NP (ADJP (RBS most) (JJ likely)) (JJ other) (NNS components)))) (. .)))",
"SIMP": [
{
"TYPE": "reduced relative clause",
"TEXT": "The complexes detected in electrophoretic mobility shift assays",
"FROM": 701,
"TO ": 764,
"COMP": [
{
"TYPE": "referred noun phrase",
"FROM": 701,
"TO ": 714
},
{
"TYPE": "clause",
"FROM": 715,
"TO ": 764
}
]
},
{
"TYPE": "noun or noun phrase coordination",
"TEXT": "p50, p65 (RelA), c-Rel, and most likely other components",
"FROM": 773,
"TO ": 829,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 773,
"TO ": 788
},
{
"TYPE": "conjunct",
"FROM": 790,
"TO ": 795
},
{
"TYPE": "conjunction",
"FROM": 797,
"TO ": 800
},
{
"TYPE": "conjunct",
"FROM": 801,
"TO ": 829
}
]
}
]
}
{
"TYPE": "sentence",
"TEXT": "By using transient transfection assays, we found that cross-linking CD40 supports NF-kappa B-dependent gene expression.",
"FROM": 831,
"TO ": 950,
"POS ": "By_IN using_VBG transient_JJ transfection_NN assays_NNS ,_, we_PRP found_VBD that_IN cross-linking_JJ CD40_NN supports_VBZ NF-kappa_NN B-dependent_JJ gene_NN expression_NN ._. ",
"TREE": "(ROOT (S (PP (IN By) (S (VP (VBG using) (NP (JJ transient) (NN transfection) (NNS assays))))) (, ,) (NP (PRP we)) (VP (VBD found) (SBAR (IN that) (S (NP (JJ cross-linking) (NN CD40)) (VP (VBZ supports) (NP (NP (NN NF-kappa)) (NP (JJ B-dependent) (NN gene) (NN expression))))))) (. .)))",
"SIMP": []
}
{
"TYPE": "sentence",
"TEXT": "Our results define the NF-kappa B system as an intermediate event in CD40 signaling and suggest that the CD40 pathway can influence the expression of B cell-associated genes with NF-kappa B consensus sites.",
"FROM": 951,
"TO ": 1157,
"POS ": "Our_PRP$ results_NNS define_VBP the_DT NF-kappa_NN B_NN system_NN as_IN an_DT intermediate_JJ event_NN in_IN CD40_NN signaling_NN and_CC suggest_VBP that_IN the_DT CD40_NN pathway_NN can_MD influence_VB the_DT expression_NN of_IN B_NN cell-associated_JJ genes_NNS with_IN NF-kappa_NN B_NN consensus_NN sites_NNS ._. ",
"TREE": "(ROOT (S (NP (PRP$ Our) (NNS results)) (VP (VP (VBP define) (NP (DT the) (NN NF-kappa) (NN B) (NN system)) (PP (IN as) (NP (NP (DT an) (JJ intermediate) (NN event)) (PP (IN in) (NP (NN CD40) (NN signaling)))))) (CC and) (VP (VBP suggest) (SBAR (IN that) (S (NP (DT the) (NN CD40) (NN pathway)) (VP (MD can) (VP (VB influence) (NP (NP (DT the) (NN expression)) (PP (IN of) (NP (NN B) (JJ cell-associated) (NNS genes)))) (PP (IN with) (NP (NN NF-kappa) (NN B) (NN consensus) (NNS sites))))))))) (. .)))",
"SIMP": [
{
"TYPE": "verb or verb phrase coordination",
"TEXT": "define the NF-kappa B system as an intermediate event in CD40 signaling and suggest that the CD40 pathway can influence the expression of B cell-associated genes with NF-kappa B consensus sites",
"FROM": 963,
"TO ": 1156,
"COMP": [
{
"TYPE": "conjunct",
"FROM": 963,
"TO ": 1034
},
{
"TYPE": "conjunction",
"FROM": 1035,
"TO ": 1038
},
{
"TYPE": "conjunct",
"FROM": 1039,
"TO ": 1156
}
]
}
]
}
The B cell-associated surface molecule CD40 functions to regulate B cell responses. Cross-linking CD40 on B cells can lead to homotypic cell adhesion, IL-6 production, and, in combination with cytokines, to Ig isotype switching. Tyrosine kinase activity is increased shortly after engagement of this receptor. Little is known about how the very early events induced by CD40 cross-linking link to cellular responses. In this study, we demonstrate that nuclear factor (NF)-kappa B and NF-kappa B-like transcription factors are activated after cross-linking CD40 on resting human tonsillar B cells and on B cell lines. The activation is rapid and is mediated through a tyrosine kinase-dependent pathway. The complexes detected in electrophoretic mobility shift assays contain p50, p65 (RelA), c-Rel, and most likely other components. By using transient transfection assays, we found that cross-linking CD40 supports NF-kappa B-dependent gene expression. Our results define the NF-kappa B system as an intermediate event in CD40 signaling and suggest that the CD40 pathway can influence the expression of B cell-associated genes with NF-kappa B consensus sites.
\ No newline at end of file
#!/bin/bash
#Validate arguments
if [[ ! ("$#" == 2 ) ]]; then
echo 'Usage: ./sentence-simplification-main.sh <input_path> <output_file_path>'
exit 1
fi
SCRIPT_PATH=$(cd `dirname $0` && pwd)
#Define aquí la palabra clave del grupo de oraciones a simplificar.
INPUT_PATH=$1
OUTPUT_INDEX_FILE_PATH=$2
cd $SCRIPT_PATH
#ANALIZAR EN ISIMP
echo "Analysing in iSimp..."
if [ -z "$(ls -A ./iSimp_sentences/)" ]; then :
else
#echo "Not Empty"
rm ./iSimp_sentences/*
fi
#cd $INPUT_PATH
for j in $INPUT_PATH/*
do
echo $j
#echo "++++entrada_simp: $j salida_simp: $SCRIPT_PATH/iSimp_sentences/$(basename $j)"
$SCRIPT_PATH/isimp_v2/simplify.sh $j $SCRIPT_PATH/iSimp_sentences/$(basename $j)
done
cd $SCRIPT_PATH
#CREA INDICE DE ARCHIVOS SIMPLIFICADOS
#touch $SCRIPT_PATH/index.txt
>| $OUTPUT_INDEX_FILE_PATH
#ALIMENTAR A ALGORITMO
echo "Analysing in Algorithm..."
if [ -z "$(ls -A ./algorithm_sentences/)" ]; then :
else
#echo "Not Empty"
rm ./algorithm_sentences/*
fi
#cd ./iSimp_sentences
for k in $SCRIPT_PATH/iSimp_sentences/*
do
echo $k
#echo "entrada: $k salida: $SCRIPT_PATH/algorithm_sentences/$(basename $k) index: $OUTPUT_INDEX_FILE_PATH"
python2 $SCRIPT_PATH/simplifier.py $k $SCRIPT_PATH/algorithm_sentences/$(basename $k) $OUTPUT_INDEX_FILE_PATH
done
cd $SCRIPT_PATH
import copy
import sys
import requests
class Simp(object):
def __init__(self):
self.TYPE=""
self.TYPEx=0
self.TYPEy=0
self.TEXT=""
self.COMP=[]
def agregarTYPE(self,Type):
self.TYPE=Type
def agregarTEXT(self,text):
self.TEXT=text
def agregarCOMP(self,comp):
self.COMP.append(comp)
class Frase(object):
def __init__(self):
self.TYPE=""
self.TEXT=""
self.POS=""
self.TREE=""
self.SIMP=[]
def agregarTYPE(self,Type):
self.TYPE=Type
def agregarTEXT(self,text):
self.TEXT=text
def agregarPOS(self,Pos):
self.POS=Pos
def agregarTREE(self,Tree):
self.TREE=Tree
def agregarSIMP(self):
self.SIMP.append(Simp())
class Sentence(object):
def __init__(self):
self.FLAG=True
self.TEXT=""
self.TREE=""
self.SIMP=[]
def agregarTEXT(self,text):
self.TEXT=text
def agregarTREE(self,Tree):
self.TREE=Tree
def agregarSIMP(self):
self.SIMP.append(Simp())
MEMORIAB=[]
MEMORIAA=[]
#----lectura de datos desde archivo
arch=(sys.argv[1])
f = open(arch)
dato = f.read().splitlines()
f.close
frase=Frase()
for i in range(len(dato)):
if 'TYPE: ' in dato[i][0:6]:
frase.agregarTYPE(dato[i][6:])
elif 'TEXT: ' in dato[i][0:6]:
frase.agregarTEXT(dato[i][6:])
elif 'POS : ' in dato[i][0:6]:
frase.agregarPOS(dato[i][6:])
elif 'TREE: ' in dato[i][0:6]:
frase.agregarTREE(dato[i][6:])
elif 'SIMP:' in dato[i]:
frase.agregarSIMP()
elif ' TYPE: ' in dato[i][0:8]:
frase.SIMP[-1].agregarTYPE(dato[i][8:])
elif ' TEXT: ' in dato[i][0:8]:
frase.SIMP[-1].agregarTEXT(dato[i][8:])
elif ' COMP: ' in dato[i]:
frase.SIMP[-1].agregarCOMP(dato[i][8:])
#------------
#-------Programa principal
#Algoritmo v4
if ((frase.TYPE.find('sentence')) !=- 1) and (frase.SIMP!=[]) and (frase.SIMP[0].TYPE != ''):
y=1
w=1
SIMPworkspace=[]
# copia TREE y cada SIMP a SENTENCE.1
Sentence1=Sentence()
Sentence1.TREE=copy.deepcopy(frase.TREE)
Sentence1.TEXT=copy.deepcopy(frase.TEXT)
for i in range(len(frase.SIMP)):
#Sentence1.SIMP.append(Simp())
#Sentence1.SIMP[i]=copy.deepcopy(frase.SIMP[i])
SIMPworkspace.append(Simp())
SIMPworkspace[i]=copy.deepcopy(frase.SIMP[i])
## ORDENAMIENTO DE SIMPs
for i in range(len(SIMPworkspace)):
#print SIMPworkspace[i].TEXT
#print SIMPworkspace[i].TYPE
SIMPworkspace[i].TYPEx = int(SIMPworkspace[i].TYPE[SIMPworkspace[i].TYPE.find('[')+1:SIMPworkspace[i].TYPE.find('..')])
SIMPworkspace[i].TYPEy = int(SIMPworkspace[i].TYPE[SIMPworkspace[i].TYPE.find('..')+2:SIMPworkspace[i].TYPE.find(']')])
if 'parenthesis' in SIMPworkspace[i].TYPE:
SIMPworkspace[i].TYPEy = SIMPworkspace[i].TYPEy + 2
#print SIMPworkspace[i].TYPEx
#print SIMPworkspace[i].TYPEy
SIMPworkspace.sort(key=lambda x: x.TYPEy, reverse=True)
SIMPworkspace.sort(key=lambda x: x.TYPEx)
# for i in range(len(SIMPworkspace)):
# print "\nSIMP " + str(i) + " :"
# print SIMPworkspace[i].TYPE
# print SIMPworkspace[i].TYPEx
# print SIMPworkspace[i].TYPEy
# print "\n"
for i in range(len(SIMPworkspace)):
Sentence1.SIMP.append(Simp())
Sentence1.SIMP[i]=copy.deepcopy(SIMPworkspace[i])
# Agrega la oracion original Sentence1 a la memoria como primer objeto en ser analizado
MEMORIAB.append(Sentence())
MEMORIAB[0]=copy.deepcopy(Sentence1)
# 1 entrada al bucle A por cada SIMP diferente en Sentence1
numSimp=len(Sentence1.SIMP)
s = 0
#bucle A
while s < numSimp :
#print "\nEntro por vez " + str(s) + " al bucle A"
#print "Analizando todos los SIMP de tipo: " + MEMORIAB[0].SIMP[s].TYPE
#Entra al bucle B el numero de veces igual al numerode elementos en MEMORIAB
numMEM = len(MEMORIAB)
t = 0
#bucle B
while t < numMEM :
#print "Entro por vez " + str(t) + " al bucle B"
#Entra si la oracion no ha sido analizada antes (FLAG==True) y si el texto del simp esta presente en la oracion.
#print "CONDICIONES:"
#print "SIMP " + MEMORIAB[0].SIMP[s].TEXT
#print "SIMP " + MEMORIAB[0].SIMP[s].TYPE
#print "MEMB " + str(MEMORIAB[t].FLAG)
#print "MEMB " + MEMORIAB[t].TEXT
if ( MEMORIAB[0].SIMP[s].TEXT in MEMORIAB[t].TEXT ) and ( MEMORIAB[t].FLAG == True ):
MEMORIAB[t].FLAG = False
#print "False to: " + MEMORIAB[t].TEXT
#print "Entro a condicional"
#Reglas de simplificacion
if ( 'coordination' in MEMORIAB[t].SIMP[s].TYPE ) and ( not ('sentence coordination' in MEMORIAB[t].SIMP[s].TYPE ) ) :
#print "Aplico regla coord"
TEMPORALES = []
c = len(MEMORIAB[t].SIMP[s].COMP)
#print "Hay " + str(c) + " COMP en este SIMP"
tt = 0
while c > 0 :
c = c - 1
if ( 'conjunct' in MEMORIAB[0].SIMP[s].COMP[c] ) and ( not ( 'conjunction' in MEMORIAB[0].SIMP[s].COMP[c] ) ) :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t])
replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
tt = tt + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'parenthesis' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla par"
TEMPORALES = []
c = len(MEMORIAB[t].SIMP[s].COMP)
#print "Hay " + str(c) + " COMP en este SIMP"
tt = 0
while c > 0 :
#print "entro al while de par"
c = c - 1
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t])
replaced = MEMORIAB[0].SIMP[s].TEXT + ' )'
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
#print "replaced: " + replaced
#print "replacer: " + replacer
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
tt = tt + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'apposition' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla Apposition"
TEMPORALES = []
c = len(MEMORIAB[t].SIMP[s].COMP)
#print "Hay " + str(c) + " COMP en este SIMP"
tt = 0
while c > 0 :
#print "entro al while de par"
c = c - 1
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t])
replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
#print "replaced: " + replaced
#print "replacer: " + replacer
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
tt = tt + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print "Copio a memoria: " + MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'member-collection' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla member-collection"
TEMPORALES = []
c = len(MEMORIAB[t].SIMP[s].COMP)
#print "Hay " + str(c) + " COMP en este SIMP"
tt = 0
while c > 0 :
#print "entro al while de mem"
c = c - 1
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t])
replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
#print "replaced: " + replaced
#print "replacer: " + replacer
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
tt = tt + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print "Copio a memoria: " + MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'sentence coordination' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla Verb"
TEMPORALES = []
c = len(MEMORIAB[t].SIMP[s].COMP)
#print "Hay " + str(c) + " COMP en este SIMP"
tt = 0
while c > 0 :
c = c - 1
if ( 'conjunct' in MEMORIAB[0].SIMP[s].COMP[c] ) and ( not ( 'conjunction' in MEMORIAB[0].SIMP[s].COMP[c] ) ) :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t])
#sustituye todo el contenido de TEMPORAL.r/TREE, por el contenido la oracion coordinada
#replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
#print replacer
TEMPORALES[tt].TEXT = replacer
## si la oracion no termina en punto o !
tt = tt + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'full relative clause' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla RelCl"
TEMPORALES = []
c = 0
tt = 0
while c < 2 :
if 'referred noun phrase' in MEMORIAB[0].SIMP[s].COMP[c] :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t]) #ok
if MEMORIAB[0].TEXT[MEMORIAB[0].TEXT.index(TEMPORALES[tt].SIMP[s].TEXT)+len(TEMPORALES[tt].SIMP[s].TEXT)-1] == ',':
replaced = MEMORIAB[0].SIMP[s].TEXT + ',' #posible error, si es asi probar con ' ,'
else:
replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
indice3 = indice1
indice4 = indice2
if 'clause' in MEMORIAB[0].SIMP[s].COMP[c] :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t]) #ok
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
TEMPORALES[tt].TEXT = copy.deepcopy(MEMORIAB[0].TEXT[indice3:indice4]+' '+MEMORIAB[0].TEXT[indice1:indice2] ) ##
cad3 = MEMORIAB[0].TEXT[indice1:indice2]
cad4 = cad3.split()
if (cad4[0]+'_WDT') in frase.POS:
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(' '+cad4[0],'')
tt = tt + 1
c = c + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'reduced relative clause' in MEMORIAB[t].SIMP[s].TYPE:
#print "Aplico regla RelCl"
TEMPORALES = []
c = 0
tt = 0
while c < 2 :
if 'referred noun phrase' in MEMORIAB[0].SIMP[s].COMP[c] :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t]) #ok
replaced = MEMORIAB[0].SIMP[s].TEXT
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
#subj = MEMORIAB[0].TEXT[indice1:(indice2+1)]
subj = MEMORIAB[0].TEXT[indice1:(indice2)]
TEMPORALES[tt].TEXT = TEMPORALES[tt].TEXT.replace(replaced,replacer)
if 'clause' in MEMORIAB[0].SIMP[s].COMP[c] :
TEMPORALES.append(Sentence())
TEMPORALES[tt] = copy.deepcopy(MEMORIAB[t]) #el referente debera estar antes que la clausula para tener orden correcto
indice1 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('[')+1:TEMPORALES[tt].SIMP[s].COMP[c].find('..')])
indice2 = (int)(TEMPORALES[tt].SIMP[s].COMP[c][TEMPORALES[tt].SIMP[s].COMP[c].find('..')+2:TEMPORALES[tt].SIMP[s].COMP[c].find(']')])
replacer = MEMORIAB[0].TEXT[indice1:indice2]
TEMPORALES[tt].TEXT = subj + " _ " + replacer #en este punto para ingresar copula necesitas info de numero y tiempo
tt = tt + 1
c = c + 1
#copiar simplificaciones de memoria temporal a MEMORIAB
indtempamem = 0
while indtempamem < len(TEMPORALES) :
MEMORIAB.append(Sentence())
MEMORIAB[-1]=copy.deepcopy(TEMPORALES[indtempamem])
MEMORIAB[-1].FLAG = True
#print MEMORIAB[-1].TEXT
indtempamem = indtempamem + 1
elif 'hypernymy' in MEMORIAB[t].SIMP[s].TYPE:
print "**hypernymy detected**"
#print "True to: " + MEMORIAB[t].TEXT
MEMORIAB[t].FLAG = True
else:
print "Error: Unknown simplification construct detected."
#print "True to: " + MEMORIAB[t].TEXT
MEMORIAB[t].FLAG = True
t = t + 1
s = s + 1
#CONDICIONES PARA IMPRESION DE SIMPLIFICACIONES EN ARCHIVO DE TEXTO
print "Sentence simplificated. New sentences generated:"
for i in range(len(MEMORIAB)):
#se reutiliza flag para marcar las oraciones finales
MEMORIAB[i].FLAG = True
for j in range(len(MEMORIAB[0].SIMP)):
#NOTA: si se agrega un constructo simplificable, anadirlo tambien a esta lista:
if ( ('member-collection' in MEMORIAB[0].SIMP[j].TYPE) or ('apposition' in MEMORIAB[0].SIMP[j].TYPE) or ('coordination' in MEMORIAB[0].SIMP[j].TYPE) or ('parenthesis' in MEMORIAB[0].SIMP[j].TYPE) or ('sentence coordination' in MEMORIAB[0].SIMP[j].TYPE) or ('full relative clause' in MEMORIAB[0].SIMP[j].TYPE) or ('reduced relative clause' in MEMORIAB[0].SIMP[j].TYPE) ) and (MEMORIAB[0].SIMP[j].TEXT in MEMORIAB[i].TEXT) :
MEMORIAB[i].FLAG = False
##areglar numeracion archivos salida ej 011
arcsalnum = 0
for i in range(len(MEMORIAB)):
if MEMORIAB[i].FLAG == True:
arcsalnum = arcsalnum + 1
length = len(str(arcsalnum))
#print('{:03d}'.format(arcsalnum)) # python >= 2.7 + python3
# >>> n = '4'
#>>> print n.zfill(3)
arcsalnum = 0
for i in range(len(MEMORIAB)):
if MEMORIAB[i].FLAG == True:
arcsalnum = arcsalnum + 1
print MEMORIAB[i].TEXT#Salida
archSalNombre = sys.argv[2]
archSalNombre=archSalNombre[:-4] + "-" + (str(arcsalnum)).zfill(length) + '.alg'
archivoSalida=open(archSalNombre,"w")
archivoSalida.write(MEMORIAB[i].TEXT+"\n")##
archivoSalida.close()
#WRITE OUTPUT FILE PATH TO INDEX (Arg 3)
index_name = sys.argv[3]
index = open(index_name, "a+")
archSalNombreforIndex=archSalNombre + "\n"
index.write(archSalNombreforIndex)
index.close()
else:
print frase.TEXT #----Salida si no habia constructos simplificables
archSalNombre = sys.argv[2]
archSalNombre = archSalNombre[:-4] + ".alg"
archivoSalida = open(archSalNombre,"a+")
archivoSalida.write(frase.TEXT+"\n")##
archivoSalida.close()
#WRITE OUTPUT FILE PATH TO INDEX (Arg 3)
index_name = sys.argv[3]
index = open(index_name, "a+")
archSalNombreforIndex=archSalNombre + "\n"
index.write(archSalNombreforIndex)
index.close()
#FIN