old_contents: import nltk
  
  class RelationGrammerParser(object):
      pass
new_contents: import nltk
  
  class RelationGrammerParser(object):
      
      def __init__(self):
          grammer = r"""
              V: {<RB>?<MD|VB|VBD|VBP|VBG|VBN><RP|RB>?}
              P: {<RB>?<IN|TO|RP><RB>?}
              W: {<PRP$|CD|DT|JJ|JJS|JJR|NN|NNS|NNP|NNPS|POS|RB|RBR|RBS|VBN|VBG>*}
              RelP1: {(<V><P>?)*}
              RelP2: {(<V>(<W>*<P>)?)*}
              RelPhrase: {(<RelP1>*|<RelP2>*)?}
          """
          
          self.parser = nltk.RegexpParser(grammer)
      
      
      def parse(self, tokenized_sent):
          
          return self.parser.parse(tokenized_sent)
      
subject: define grammer parser in own module instead of with extractor