regex - How to match parenthesis in StanfordNLP regexNER? -


i want use stanfordnlp regexner annotate data using dictionary lists. unfortunately not able match parenthesis within pattern in :

"iq (ma) max" 

where match should either "iq" or "iq (ma) max"

i tried different regex, such

iq(\s\(\sma\s\)\smax)?   iq(\\s\\(\\sma\\s\\)\\smax)? 

but nothing worked.it matches "iq"
can help? possible @ regex?

your rule should formatted way:

iq -lrb- ma -rrb- max    entity    misc    1 

if want after iq optional, think easiest thing write separate rule iq

each element of space separated list @ beginning of regexner rule regular expression matches token, if add question marks can make of tokens in pattern optional, i'm not sure there's way make them optional group or not.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -