Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing words case or abbreviation in sentences
#1
Hi Gintaras, hi all
i need a little help to tune a routine.

In some sentences I want to replace casing or value of certain patterns to keep them always in certain form.
Example, in english, the "i" meaning "me" should always be upper case.

So i did that, which works well:

str ff="the phrase where i want the i in upper case"
ff.replacerx("i" "I" 2|8|32)
out ff gives "the phrase where I want the I in upper case"

So far, so good.

But with certain patterns (i want to rephrase some classical music m4a tags) it fails.

no should become N°
Op. should become Opus

ff.replacerx("no" "N°" 2|8|32)
ff.replacerx("Op." "Opus" 2|8|32)
does not work.

All those patterns are alone, ie previous and following are spaces (bla no bla, bla bala Op. bla bla, my sentence with i is that...)

If you have a solution for the two examples or a better way to achieve my goal...

Thanks


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)