-1

I will explain what I wanna do.

If I have a text like "go there Jack" and I wanna automate rewriting it as "Jack went there".
Let's imagine it's a lengthy text over thousands of lines and has a fixed format over time like "go there Jonh", "go there Joe", "go there Smith".. etc (these are just imaginary examples but the text is not much different).

So i wanna ask is there a tool or a programming language library to automate such task ?

NB: " i have heard about text filters in linux but google didn't help me"

SteepCurver
  • 503
  • 1
  • 6
  • 8
  • R u trying to replcae the existing strings in a file? If yes then you can use sed or perl – Raghuram Nov 25 '10 at 04:54
  • There are [several Python libraries](https://stackoverflow.com/questions/3753021/using-nltk-and-wordnet-how-do-i-convert-simple-tense-verb-into-its-present-pas) that can convert a verb's infinitive form into its past tense. – Anderson Green Jul 27 '17 at 01:51

2 Answers2

0

Mmm, I'd say go with some kind of scripting language for something like that. Try Python. Also, depending on how complex these patterns get you might want to look into Regular Expressions. so python+regular expressions imho.

Shai UI
  • 50,568
  • 73
  • 204
  • 309
0

If the text has fixed text as go there <name> then you can use regular expression to do a match with /go there (.*)/i and create new string using the matched string + ' went there'

It helps if you specify which language you are using so an example can be given.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740