> Craig,
>
> At first I thought -- of course not! But then I read your
> post again, and here is one crazy idea:
>
> These words that you need to keep in upper case,
> they probably occur in some other text that you
> deal with -- outside of your "capped section headings" ?
> If you read the normal body text too -- these words
> are likely to be there, if they occur in the headings.
>
> So, my point is -- you can try to "generate" your dictionary
> from that body text. So you wouldn't build it manually.
>
> Eugene Haimov
> www.artisolve.com
>
------------------->
> I need to take capped section headings and change them into initial or
> tital case. I have coding that does this.
>
> However, my logic also changes acronym names such as IBM and PDF into
> Ibm and Pdf.
>
> Is there a way to exempt certain words or configurations of letters
> without building a dictionary or lookup table or whitelist?
>
>
> -- Craig
-------------------------
Like Eugene, I thought at first there would be no way, but his post and the
others have at least shown some possibilities. Here's another variant idea
that came to me from reading Eugene's post:
Assumption 1: The bulk of your article is in normal mixed case
Assumption 2: Any acronyms in the title also appear in the body of the
article
Assumption 3: Acronyms appearing in the body of the text are in all caps in
the body.
Method:
For each word in the title, search for a match in the body of the article.
If no match is found
{convert the word to an initial cap}
else
{if the word from the body text has a capital anywhere other than its
first letter
{make the title word match the capitalization of the word in the body}
else
{make the title word an initial cap.}
}
This has the advantage of handling any length acronym and also those that
are mixed case like BPoE. In addition you don't have to carry around a table
that might need to be maintained as new acronyms arise.
Hope that helps!
Valerie
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs