Skip to content

Commit

Permalink
added function for tregex (tree node matching)
Browse files Browse the repository at this point in the history
As in Corenlp 3.7.0 tregex function is added similar to semregex and tokensregex, I added this function to python wrapper.
Please accept the pull request.
  • Loading branch information
ketulgupta1995 committed Jan 2, 2017
1 parent e459bd4 commit 7f5f7ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions corenlp_pywrap/pywrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ def semgrex(data, pattern='', custom_filter=''):
root.info('SemRegex started')
return CoreNLP.regex('/semgrex', data, pattern, custom_filter)

@staticmethod
def tregex(data, pattern='', custom_filter=''):
root.info('Tregex started')
return CoreNLP.regex('/tregex', data, pattern, custom_filter)

@classmethod
def regex(cls, endpoint, data, pattern, custom_filter):
url_string = '/?pattern=' + str(pattern) +'&filter=' + custom_filter
Expand Down

0 comments on commit 7f5f7ee

Please sign in to comment.