Re: Capitalize special cases

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 32743
interpreted = N
texte = I have been thinking about this and the correct method should be to capitalize the first character following any amount of whitespace. This will not handle the correct capitalization of names, but you have no realistic hope to accomplish that (think O'Malley vs MacDuff).You should not toggle the capitalization for any punctuation character; that is just plain wrong. I believe the appropriate regexp would be: [:space:]+[:alpha:]Note that this does not work with the version of grep which you have in WebCat. Could you document better what grep terms are permitted and which are not? It appears that character sets (e.g. [a-z]) are included but the extended classes are not ( e.g. [:lower:] corresponds to [a-z], except that it also works with other character sets).It should also be documented that \0 returns the original string. So the following: [grep search=([a-z])([a-z]*)&replace=\1\0]fish[/grep]will return ffishI was expecting it to be 0-based (like perl), so I was confused by this.ThanksJohn PeacockGrant Hulbert wrote: > > >The desire to correctly capitalize names with apostrophes should not > >override the desire to correctly manage the possessive form. If the > >parser performed a lookahead and only capitalized after a apostrophe > >when the second character after is a letter, not whitespace. > > We're actually capitalizing after every non-character (to handle > periods as sentence beginnings and such), so it's just an accident > that the apostrophe works as it does. Is your proposed rule the only > one necessary? I could imagine putting that rule in, as long as we > don't start bogging down with lots of other special cases. Is there > a [grep] replacement string that could be used instead? > > This is an example of one of those features that we didn't want to > include in the first place, but the customer begged and begged and > said they didn't mind if it wasn't perfect, and now we're stuck with > it. I can imagine an endless stream of special cases for something > so willy-nilly as English grammar, which does not 'code well'. > Someday someone on the main talk list will latch onto this with the > old I asked for this 7.4 months ago, and no one at SM has fixed it > yet, and then we'll be stuck in this endless silly battle in which > we're always the bad guys. You can imagine how the fall of > civilization itself will someday be blamed on this. > > Grant Hulbert, Director of Engineering ********************************** > Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) > 16855 West Bernardo Drive, #380 | ------------------------- > San Diego, CA 92127 | Software & Site Development > Main Line: (858) 675-1106 | http://www.smithmicro.com > Fax: (858) 675-0372 ********************************** > > ############################################################# > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > To switch to the INDEX mode, E-mail to > Send administrative queries to ############################################################# This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to Associated Messages, from the most recent to the oldest:

    
  1. Re: Capitalize special cases (John Peacock 2000)
  2. Re: Capitalize special cases (John Peacock 2000)
  3. Capitalize special cases (Grant Hulbert 2000)
I have been thinking about this and the correct method should be to capitalize the first character following any amount of whitespace. This will not handle the correct capitalization of names, but you have no realistic hope to accomplish that (think O'Malley vs MacDuff).You should not toggle the capitalization for any punctuation character; that is just plain wrong. I believe the appropriate regexp would be: [:space:]+[:alpha:]Note that this does not work with the version of grep which you have in WebCat. Could you document better what grep terms are permitted and which are not? It appears that character sets (e.g. [a-z]) are included but the extended classes are not ( e.g. [:lower:] corresponds to [a-z], except that it also works with other character sets).It should also be documented that \0 returns the original string. So the following: [grep search=([a-z])([a-z]*)&replace=\1\0]fish[/grep]will return ffishI was expecting it to be 0-based (like perl), so I was confused by this.ThanksJohn PeacockGrant Hulbert wrote: > > >The desire to correctly capitalize names with apostrophes should not > >override the desire to correctly manage the possessive form. If the > >parser performed a lookahead and only capitalized after a apostrophe > >when the second character after is a letter, not whitespace. > > We're actually capitalizing after every non-character (to handle > periods as sentence beginnings and such), so it's just an accident > that the apostrophe works as it does. Is your proposed rule the only > one necessary? I could imagine putting that rule in, as long as we > don't start bogging down with lots of other special cases. Is there > a [grep] replacement string that could be used instead? > > This is an example of one of those features that we didn't want to > include in the first place, but the customer begged and begged and > said they didn't mind if it wasn't perfect, and now we're stuck with > it. I can imagine an endless stream of special cases for something > so willy-nilly as English grammar, which does not 'code well'. > Someday someone on the main Talk List will latch onto this with the > old I asked for this 7.4 months ago, and no one at SM has fixed it > yet, and then we'll be stuck in this endless silly battle in which > we're always the bad guys. You can imagine how the fall of > civilization itself will someday be blamed on this. > > Grant Hulbert, Director of Engineering ********************************** > Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) > 16855 West Bernardo Drive, #380 | ------------------------- > San Diego, CA 92127 | Software & Site Development > Main Line: (858) 675-1106 | http://www.smithmicro.com > Fax: (858) 675-0372 ********************************** > > ############################################################# > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > To switch to the INDEX mode, E-mail to > Send administrative queries to ############################################################# This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to John Peacock

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

PCS Frames (1997) [WebDNA] [announce] MacTel Beta 04 (2009) Re:Emailer problem....still (1997) [WebDNA] Encode cookies ONLY via "method=Base64" (2012) Creating main- and sub-category search (1997) PCS Frames (1997) Making a page expire with web catalog? (1999) FormVariable (1999) Credit Card Number checking (1997) WebDNA security (2004) matching shipto and others (1998) Re:I want my files to have an asp file extension (1999) Calculating Shipping (1997) Variables (1999) url value (2002) wish list (2002) BUG in [showif] using ^ (contains) (1997) WebCat2.0 [format thousands .0f] no go (1997) Identical [Replace] contexts, different results in different directories? (2000) transferring values (1998)