Feature Request: Using replaced terms in replacement text
See original GitHub issueSeems simple on the surface, but it might be a little difficult to implement, idk
Essentially, something like:
let doc = nlp("She sells seashells on the seashore");
doc.replace("#Pronoun #Verb", "#1 #0");
console.log(doc.text());
// outputs "sells She seashells on the seashore"
it could also do things like:
let doc = nlp("Do you want to build a snowman?");
doc.replace("#Determiner #Noun", "#0 bigger #1");
console.log(doc.text());
// outputs "Do you want to build a bigger snowman?"
Would be very helpful, and tbh I’m new to this so there might be a way to do it already. Thanks for your time!
Edit: I wasn’t sure what to use for the replacement terms, so I went with #index-of-word-in-replacement-text , as you might want to replace a string with multiple of the same type or something. I’d welcome any other ways of doing this though 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Find and replace text | Feature Requests - Pitch - Canny
Using a shortcut command on keyboard e.g cmd + F to find text within a presentation. This allows us to quickly allocate content...
Read more >[Feature Request]: Replace and prevent non-inclusive terminology ...
Overview This feature request proposes replacement and prevention of non-inclusive ... Replacing non-inclusive terminology is more than text changes.
Read more >Save keystrokes with text replacements on iPhone
Have a word or phrase you use and don't want it corrected? · Go to Settings > General > Keyboard, then tap Text...
Read more >Find and Replace - Text - Adobe XD: Feature Requests
PLEASE ADOBE. This is a basic ask. Having to go through multiple artboards, body copy, groups, etc. to replace a simple CAP treatment...
Read more >How to Find and Replace Text in Word - Nira
This article will guide you through the necessary steps to help you find and replace text in MS Word. Ready?
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
This is a lovely idea. I also like the syntax. I’m happy to do this. I’ll add it to v14.
this is live in v14, but I haven’t tested it very hard. Please let me know if you see any issues cheers