Only thing I found was a posting about proper case see below, looks like you
will have to go through your data and write an exception rule for the Mc,
Mac, etc. See Dan's note at the bottom
Thanks
Below is the the built-in fusionpro propercase rule that I'm using. I want
to exclude certain words from the rule. There will be certain word
exceptions that must remain lowercase and certain word exceptions that
must remain uppercase. Is there a way to do this?

The exceptions that will remain upper or lower are: CEO, CFO, VP, and,
the, of, to

--------

Var1="title";
CaseSelection="propercase";
 

if(CaseSelection == "allcaps")

 return ToUpper(Field(Var1));

 

if(CaseSelection == "smallcaps")

 return "<smallcap>" + Field(Var1) + "</smallcap>";

 

if(CaseSelection == "propercase")

 return ToTitleCase(Field(Var1));

 

if(CaseSelection == "lowercase")

 return ToLower(Field(Var1));



There may be a more efficient solution, but here's what I came up with:

    function ToCase(text, CaseSelection)
    {
        switch (ToLower(CaseSelection))
        {
          case "allcaps":
          case "uppercase":
            return ToUpper(text);
          case "lowercase":
            return ToLower(text);
          case "propercase":
            return ToTitleCase(text);
          case "smallcaps":
            return "<smallcap>" + text + "</smallcap>";
          default:
            return text;
        }
    }

    var CaseSelection="propercase";
    var text = "hi there CEO of the big corp.";

    var Exceptions = [ "CEO", "CFO", "VP", "and", "the", "of", "to" ];
    var result = ToCase(text, CaseSelection);
    for (var i in Exceptions)
    {
      var re = RegExp("\\b" + Exceptions[i] + "\\b", "gi");
      result = result.replace(re, Exceptions[i]);
    }

    return result;

Note how, if you validate this as written, the word "There" in the
result is still capitalized, while the word "the" is not.  This is
because I'm using the \b modifier on the regular expression to denote
word boundaries, so that only whole words get replaced.

Also, the whole exceptions thing won't really affect the "smallcaps"
case.  That's really the odd man out here anyway; I would think that you
would probably want to combine title case with smallcaps.

Finally, my usual caveat applies here:  Know Thy Data.  You can keep
adding exceptions as you discover them, but this is never going to be a
comprehensive solution, because you'll never be able to come up with the
full list of exceptions to "title case" or "proper case" logic.  The
English language is just too complex for that, and the number of proper
nouns (names) which do not fit the pattern is basically unlimited
(McDonald's, Mies van der Rohe, USA, etc.)  There are some kinds of
things that simply can't be reduced to an algorithm.
 
Dan


Dawn McAtee Wheeler
Ideal Printers, Inc.
713-880-8800
Fax 713-880-8875




+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!


Variable text on a curve and soft drop-shadows for variable text


LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade

New licenses available for $599 each at:
http://fusionpro.printable.com/store/

All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED] 
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to