Hm.. just a thought... if you put all the acronyms into a queue, and have
some place to store the word-numbers for those.

In your example with "only" (ey.. where in the computer world ;)) 1 acronym
you enqueue it and adds to some array or other data storage that the first
acronym in the queue should be at word number 12 in the sentence.

Now, use some fancy regexp to make the cases be the way they should be, and
after that you can add the acronyms into the sentence again.

Since this will lead to a lot of string concatenations you should use a
StringBuilder.

hth,
Andreas Häber

----- Original Message -----
From: "Stefan Finch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 6:44 PM
Subject: [DOTNET] Correcting The Case Of Strings


Does anyone know of a good approach (or code snippet even) to correct the
grammatical case of a string.
The strings have been concatenated from several sources and are in a mess.

However, I'll need it to ignore acronyms

such that     "the pointy headed Boss has Just come out with Yet Another
TLA"
becomes     "The pointy headed boss has just come out with yet another TLA"

and             "the pointy headed Boss has Just come out with Yet Another
T.L.A."
becomes     "The pointy headed boss has just come out with yet another
T.L.A."


I'm guessing I'll need a RegExp (in which case how do get it to leave
acronyms alone).



Best wishes

S





Stefan Finch. < CD9.com <http://www.cd9.com/>  >
Park House, 116 Park St, Mayfair,  <http://www.cd9.com/map> London, W1K 6NR
| 020 7659 3912 | [EMAIL PROTECTED]

  _____

<Internet Email Confidentiality Footer>
This e-mail may be confidential and does not necessarily represent the views
of CD9Group. If you are not the intended recipient of this e-mail or any
parts of it then please immediately delete it from your system and contact
CD9Group on +44 20 7659 3900. You should not disclose the contents to any
other person, nor take copies.



You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to