Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text options appear to be broken #953

Closed
GrumpyLittleTed opened this issue Aug 27, 2022 · 3 comments
Closed

text options appear to be broken #953

GrumpyLittleTed opened this issue Aug 27, 2022 · 3 comments

Comments

@GrumpyLittleTed
Copy link
Contributor

In the example from https://observablehq.com/@spencermountain/compromise-text
the result is not as expected:

{
let doc = nlp(Dr. John Smith-McDonald...)
let opts = {
punctuation: true,
abbreviations: true,
case: true,
}
return doc.text(opts)
}

result is "Dr.` John Smith-McDonald..." (unchanged from input text)

@spencermountain
Copy link
Owner

thanks, not sure what's up here. will check it out for next release

@spencermountain
Copy link
Owner

oof, these text options are a mess, and need to be fixed in our next breaking release.

Right now the fix on dev now supports this, will release it tmrw:

let doc = nlp("Dr. John Smith-McDonald...?  ")
let opts = {
  keepPunct: false,
  keepSpace: false,
  case: false,
}
console.log(doc.text(opts) + '|')
// 'Dr. John Smith McDonald|'

cheers

@spencermountain spencermountain mentioned this issue Nov 4, 2022
Merged
@spencermountain
Copy link
Owner

released in 14.7.0
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants