question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dealing with nested sentences

See original GitHub issue

I’m evaluating compromise for building a scripting/narration engine for a project. I’m trying to build a command to make a character say something, and the quotes within a single sentence are giving me problems. For example:

const input = `The girl says "Hey! gimme the meatballs!".`
const sentences = nlp(input).json().map(o=> o.text)
console.log('sentences:', sentences)     // prints   ['The girl says "Hey!', 'gimme the meatballs!".']

I was expecting this to be one sentence. Any recommendations on how to deal with these types of input? My plan was to split the entire input text up into sentences and then run a small set of matches against each sentence like nlp(sentence).match('#Noun? says "[.]") but this won’t work if a sentence with quotes is getting split out.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mreinsteincommented, Jul 29, 2022

Confirmed, seems to work for a variety of cases I’ve tried.

Thanks again for this feature, it’s freakin’ sweet!

1reaction
spencermountaincommented, Jul 29, 2022

whoa! this is bad!! thank you for letting me know. will take a look at this asap

Read more comments on GitHub >

github_iconTop Results From Across the Web

What kinds of nested sentences exist in languages?
Whole sentences can be nested easily, and even more than once. ... I think any theory on the market can probably handle such...
Read more >
checksheet - linking, listing and nesting
Nesting structures which hold up the development of a sentence lead to a style which is often characterised as being "tight" or "parenthetical"....
Read more >
Use "nested" in a sentence - TranslateEN.com
"nested" ... (1) He nested himself near his field. (2) Birds had nested under the eaves. (3) He nested himself near his field....
Read more >
12 Multi-Clause Sentences
We believe that he exaggerates a great deal. These sentences include that at the beginning of the embedded clause. Words that introduce clauses...
Read more >
Nested Quotation Marks - Hollis Easter
In that long sentence above, we run into a problem with the standard approach because we don't know where to put the period...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found