mardi 17 octobre 2017

TregexPattern with Stanford parser

I want to extract two verb in this sentence.

Be assured that and send me.

Tree looks like this.

    (ROOT
       (S
          (VP
              (VP (VB Be)
                  (VP (VBN assured)
                      (NP (DT that))))
              (CC and)
              (VP (VB send)
                  (NP (PRP me))))
                      (. .)))

How can I extract VB using TregexPattern.. There is some confusing problems. 1. first VP has no contents. so whenever sentence include "and, or" I have to ignore empty VP node.

  1. Be. I want to extract assured. not Be.
  2. send. I have to find "send" using "Be", they have same dependency. but Be is not that I want.

        TregexPattern noNP = TregexPattern.compile("((@VP=verb > (S !> SBAR)) !$,,@NP)");
    
    

this is my code for extracting No-subject verb. how can I extract thoes two verb.

http://ift.tt/2ypPI5C

here is detail about patterns.

Aucun commentaire:

Enregistrer un commentaire