dealing with nested sentences
See original GitHub issueI’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:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed, seems to work for a variety of cases I’ve tried.
Thanks again for this feature, it’s freakin’ sweet!
whoa! this is bad!! thank you for letting me know. will take a look at this asap