You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to match something immediately after a #Value, when the #Value is not followed by a space?
let nlp = require('compromise');
let doc1 = nlp('An 80 year old from Panadura has died')
let doc2 = nlp('A 79-years-old woman from Colombo 13 has died in her r')
let doc3 = nlp('A 79 years old woman from Colombo 13 has died in her r')
console.log(doc1.match('[(years|-years-|year)]').lookBehind('#Value$').text()) //80
console.log(doc2.match('([years|-years-|year)]').lookBehind('#Value$').text()) //79
console.log(doc3.match('([years|-years-|year])').lookBehind('#Value$').text()) // ?
is there a way to get this working for the 3rd?
The text was updated successfully, but these errors were encountered:
hey @numberslk good question - admittedly, there are two things going wrong here in compromise -
nlp('79-years-old').debug() is being treated like one word - think because of the number-letter combo - as though it were a long ID number or hash. I can look at improving the tokenization regex for this, it's a good example.
the second thing is there is a @hasDash match function that doesn't seem to be working - nlp('foo-bar').match('@hasDash').debug() I can take a look at that one, too.
Is there a way to match something immediately after a
#Value
, when the#Value
is not followed by a space?is there a way to get this working for the 3rd?
The text was updated successfully, but these errors were encountered: