CoreNLP icon indicating copy to clipboard operation
CoreNLP copied to clipboard

Enable Keeping Nested/Overlapping Matches from CoreMapExpressionExtractor and Expose the Name

Open jrsperry opened this issue 2 years ago • 3 comments

In my work we have used tokens-regex, but I'm looking to use the lower-level CoreMapExpressionExtractor and to modify it to allow for matches that are either nested, or overlapping.

For my use case I want to see all possible matches, not just the largest or non-overlapping matches. I'm only using the result functionality of the language, not doing any annotating.

I would also like to expose the name of the ExtractFunc of the MatchedExpression.

I have changes checked in to a local branch where I expose the name, and allow for the Env of the CoreMapExpressionMatcher to allow for all the matches to be returned or not.

jrsperry avatar Oct 10 '22 17:10 jrsperry

Fork the repo and push it to your own local repo

On Mon, Oct 10, 2022 at 10:37 AM jrsperry @.***> wrote:

In my work we have used tokens-regex, but I'm looking to use the lower-level CoreMapExpressionExtractor and to modify it to allow for matches that are either nested, or overlapping.

For my use case I want to see all possible matches, not just the largest or non-overlapping matches. I'm only using the result functionality of the language, not doing any annotating.

I would also like to expose the name of the ExtractFunc of the MatchedExpression.

I have changes checked in to a local branch where I expose the name, and allow for the Env of the CoreMapExpressionMatcher to allow for all the matches to be returned or not. I'm getting access denied in pushing to a new branch however.

— Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/1307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWOUMKWTIHDVNHCQCR3WCRH4RANCNFSM6AAAAAARBRPMWU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

AngledLuffa avatar Oct 10 '22 17:10 AngledLuffa

i've already done that, I figured it may be of use to others using the CoreMapExpressionExtractor. I'll attach a PR for consideration.

jrsperry avatar Oct 10 '22 19:10 jrsperry

Not sure how to assign it to this issue but here's the PR.
https://github.com/stanfordnlp/CoreNLP/pull/1308

jrsperry avatar Oct 10 '22 19:10 jrsperry