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.

Feature Request: Using replaced terms in replacement text

See original GitHub issue

Seems 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
spencermountaincommented, Aug 13, 2021

This is a lovely idea. I also like the syntax. I’m happy to do this. I’ll add it to v14.

0reactions
spencermountaincommented, May 26, 2022

this is live in v14, but I haven’t tested it very hard. Please let me know if you see any issues cheers

Read more comments on GitHub >

github_iconTop 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 >

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