samedi 4 avril 2015

C# regular express pattern

What should be regex pattern that split words in the tagged sentence which are follow in this order (B-NP)-(B-VP)-(B-NP)-(I-NP) or (B-NP)-(I-NP)-(B-VP)-(B-NP)-(I-NP).


Sentence example:



(B-SBAR)After(B-SBAR) (B-NP)Chuck(B-NP) (I-NP)and(I-NP) (I-NP)David(I-NP) (B-VP)leave(B-VP) (B-NP)the(B-NP) (I-NP)gang(I-NP) (O),(O) (B-NP)the(B-NP) (I-NP)remaining(I-NP) (I-NP)group(I-NP) (B-ADVP)also(B-ADVP) (B-VP)split(B-VP) (B-PRT)up(B-PRT) (B-NP)into(B-NP) (I-NP)2(I-NP) (I-NP)groups(I-NP) (B-PP)of(B-PP) (B-NP)2(B-NP) (O)and(O) (B-VP)get(B-VP) (I-VP)to(I-VP) (I-VP)know(I-VP) (B-NP)each(B-NP) (I-NP)other(I-NP) (I-NP)a(I-NP) (I-NP)little(I-NP) (I-NP)better(I-NP) (O).(O)


Should be splitted:



  • Chuck leave the gang

  • the remaining split into 2

  • 2 get each other


Aucun commentaire:

Enregistrer un commentaire