Re: BUG #2579: initcap should not capitalize letter

Lists: pgsql-bugs
From: "Dan Franklin" <dfranklin(at)fen(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2579: initcap should not capitalize letter after apostrophe
Date: 2006-08-16 21:03:08
Message-ID: 200608162103.k7GL38li071530@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2579
Logged by: Dan Franklin
Email address: dfranklin(at)fen(dot)com
PostgreSQL version: 8.1.4
Operating system: GNU/Linux Fedora Core 5
Description: initcap should not capitalize letter after apostrophe
Details:

The statement
select initcap('John''s Parents');
returns
John'S Parents

The capital "S" after the apostrophe is incorrect. initcap should consider
the apostrophe to be a word-constituent for the purpose of identifying word
boundaries at which to start capitalizing.


From: tomas(at)tuxteam(dot)de
To: Dan Franklin <dfranklin(at)fen(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2579: initcap should not capitalize letter after apostrophe
Date: 2006-08-17 19:08:37
Message-ID: 20060817190837.GA8772@www.trapp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Aug 16, 2006 at 09:03:08PM +0000, Dan Franklin wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2579
> Logged by: Dan Franklin
> Email address: dfranklin(at)fen(dot)com
> PostgreSQL version: 8.1.4
> Operating system: GNU/Linux Fedora Core 5
> Description: initcap should not capitalize letter after apostrophe
> Details:
>
> The statement
> select initcap('John''s Parents');
> returns
> John'S Parents
>
> The capital "S" after the apostrophe is incorrect. initcap should consider
> the apostrophe to be a word-constituent for the purpose of identifying word
> boundaries at which to start capitalizing.

Hmm. And what about Flann O'Brien?

Tough thing, this.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE5L60Bcgs9XrR2kYRArkQAKCBI9uYSUckPWL6jzB3PFBXNAlwSgCeOoJx
NIBRgQZYqRajtx8HrUnW1Hs=
=GI/E
-----END PGP SIGNATURE-----


From: Dan Franklin <dfranklin(at)fen(dot)com>
To: tomas(at)tuxteam(dot)de
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2579: initcap should not capitalize letter
Date: 2006-08-17 19:34:41
Message-ID: 7.0.1.0.2.20060817152951.020bf018@fen.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Good point. It is probably not possible to get
it perfect. But I think that possessives and
contractions occur more often in a typical body
of text than Irish names. So it would be right
more often, even if it is still wrong some of the time.

Dan Franklin

At 03:08 PM 8/17/2006, tomas(at)tuxteam(dot)de wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Wed, Aug 16, 2006 at 09:03:08PM +0000, Dan Franklin wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: 2579
> > Logged by: Dan Franklin
> > Email address: dfranklin(at)fen(dot)com
> > PostgreSQL version: 8.1.4
> > Operating system: GNU/Linux Fedora Core 5
> > Description: initcap should not capitalize letter after apostrophe
> > Details:
> >
> > The statement
> > select initcap('John''s Parents');
> > returns
> > John'S Parents
> >
> > The capital "S" after the apostrophe is incorrect. initcap should consider
> > the apostrophe to be a word-constituent for the purpose of identifying word
> > boundaries at which to start capitalizing.
>
>Hmm. And what about Flann O'Brien?
>
>Tough thing, this.
>
>Regards
>- -- tomás
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.1 (GNU/Linux)
>
>iD8DBQFE5L60Bcgs9XrR2kYRArkQAKCBI9uYSUckPWL6jzB3PFBXNAlwSgCeOoJx
>NIBRgQZYqRajtx8HrUnW1Hs=
>=GI/E
>-----END PGP SIGNATURE-----

Dan Franklin
Family Education Network
Pearson Education
617-671-3799


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Dan Franklin <dfranklin(at)fen(dot)com>
Cc: tomas(at)tuxteam(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2579: initcap should not capitalize letter
Date: 2006-08-19 16:51:50
Message-ID: 200608191651.k7JGpol06651@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Dan Franklin wrote:
> Good point. It is probably not possible to get
> it perfect. But I think that possessives and
> contractions occur more often in a typical body
> of text than Irish names. So it would be right
> more often, even if it is still wrong some of the time.
>

The function came from Oracle. How does Oracle's initcap() handle this?

---------------------------------------------------------------------------

> Dan Franklin
>
> At 03:08 PM 8/17/2006, tomas(at)tuxteam(dot)de wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >On Wed, Aug 16, 2006 at 09:03:08PM +0000, Dan Franklin wrote:
> > >
> > > The following bug has been logged online:
> > >
> > > Bug reference: 2579
> > > Logged by: Dan Franklin
> > > Email address: dfranklin(at)fen(dot)com
> > > PostgreSQL version: 8.1.4
> > > Operating system: GNU/Linux Fedora Core 5
> > > Description: initcap should not capitalize letter after apostrophe
> > > Details:
> > >
> > > The statement
> > > select initcap('John''s Parents');
> > > returns
> > > John'S Parents
> > >
> > > The capital "S" after the apostrophe is incorrect. initcap should consider
> > > the apostrophe to be a word-constituent for the purpose of identifying word
> > > boundaries at which to start capitalizing.
> >
> >Hmm. And what about Flann O'Brien?
> >
> >Tough thing, this.
> >
> >Regards
> >- -- tom????s
> >-----BEGIN PGP SIGNATURE-----
> >Version: GnuPG v1.4.1 (GNU/Linux)
> >
> >iD8DBQFE5L60Bcgs9XrR2kYRArkQAKCBI9uYSUckPWL6jzB3PFBXNAlwSgCeOoJx
> >NIBRgQZYqRajtx8HrUnW1Hs=
> >=GI/E
> >-----END PGP SIGNATURE-----
>
> Dan Franklin
> Family Education Network
> Pearson Education
> 617-671-3799
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Dan Franklin <dfranklin(at)fen(dot)com>, tomas(at)tuxteam(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2579: initcap should not capitalize letter
Date: 2006-08-19 17:32:56
Message-ID: 44E74B48.2000505@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian wrote:
> Dan Franklin wrote:
>> Good point. It is probably not possible to get
>> it perfect. But I think that possessives and
>> contractions occur more often in a typical body
>> of text than Irish names. So it would be right
>> more often, even if it is still wrong some of the time.
>>
>
> The function came from Oracle. How does Oracle's initcap() handle this?

looks like our behaviour is similiar to what oracle does:

Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> select initcap('John''s Parents') from DUAL;

INITCAP('JOHN'
--------------
John'S Parents

SQL> select initcap('Flann O''Brian') from DUAL;

INITCAP('FLAN
-------------
Flann O'Brian

Stefan


From: Richard Troy <rtroy(at)ScienceTools(dot)com>
To: Dan Franklin <dfranklin(at)fen(dot)com>
Cc: <tomas(at)tuxteam(dot)de>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #2579: initcap should not capitalize letter
Date: 2006-08-19 17:34:21
Message-ID: Pine.LNX.4.33.0608190949520.32544-100000@denzel.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Thu, 17 Aug 2006, Dan Franklin wrote:

> Date: Thu, 17 Aug 2006 15:34:41 -0400
> From: Dan Franklin <dfranklin(at)fen(dot)com>
> To: tomas(at)tuxteam(dot)de
> Cc: pgsql-bugs(at)postgresql(dot)org
> Subject: Re: [BUGS] BUG #2579: initcap should not capitalize letter
>
> Good point. It is probably not possible to get
> it perfect. But I think that possessives and
> contractions occur more often in a typical body
> of text than Irish names. So it would be right
> more often, even if it is still wrong some of the time.
>
> Dan Franklin

Two thoughts:

1) In English at least, it's only at the trailing end of a word that the
non-capitalization is clear (contractions, possessive, etc).

2) Proper names are unknowable as to what's appropriate and I posit that
there is no algorithm that works for names.

This leads to a conclusion: Never add capitalization inside a string of
letters.

Rgds,
Richard

>
> At 03:08 PM 8/17/2006, tomas(at)tuxteam(dot)de wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >On Wed, Aug 16, 2006 at 09:03:08PM +0000, Dan Franklin wrote:
> > >
> > > The following bug has been logged online:
> > >
> > > Bug reference: 2579
> > > Logged by: Dan Franklin
> > > Email address: dfranklin(at)fen(dot)com
> > > PostgreSQL version: 8.1.4
> > > Operating system: GNU/Linux Fedora Core 5
> > > Description: initcap should not capitalize letter after apostrophe
> > > Details:
> > >
> > > The statement
> > > select initcap('John''s Parents');
> > > returns
> > > John'S Parents
> > >
> > > The capital "S" after the apostrophe is incorrect. initcap should consider
> > > the apostrophe to be a word-constituent for the purpose of identifying word
> > > boundaries at which to start capitalizing.
> >
> >Hmm. And what about Flann O'Brien?
> >
> >Tough thing, this.
> >
> >Regards
> >- -- tomás
> >-----BEGIN PGP SIGNATURE-----
> >Version: GnuPG v1.4.1 (GNU/Linux)
> >
> >iD8DBQFE5L60Bcgs9XrR2kYRArkQAKCBI9uYSUckPWL6jzB3PFBXNAlwSgCeOoJx
> >NIBRgQZYqRajtx8HrUnW1Hs=
> >=GI/E
> >-----END PGP SIGNATURE-----
>
> Dan Franklin
> Family Education Network
> Pearson Education
> 617-671-3799
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Richard Troy, Chief Scientist
Science Tools Corporation
510-924-1363 or 202-747-1263
rtroy(at)ScienceTools(dot)com, http://ScienceTools.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Richard Troy <rtroy(at)ScienceTools(dot)com>
Cc: Dan Franklin <dfranklin(at)fen(dot)com>, tomas(at)tuxteam(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2579: initcap should not capitalize letter
Date: 2006-08-19 18:21:11
Message-ID: 200608191821.k7JILBC29579@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Richard Troy wrote:
>
>
> On Thu, 17 Aug 2006, Dan Franklin wrote:
>
> > Date: Thu, 17 Aug 2006 15:34:41 -0400
> > From: Dan Franklin <dfranklin(at)fen(dot)com>
> > To: tomas(at)tuxteam(dot)de
> > Cc: pgsql-bugs(at)postgresql(dot)org
> > Subject: Re: [BUGS] BUG #2579: initcap should not capitalize letter
> >
> > Good point. It is probably not possible to get
> > it perfect. But I think that possessives and
> > contractions occur more often in a typical body
> > of text than Irish names. So it would be right
> > more often, even if it is still wrong some of the time.
> >
> > Dan Franklin
>
> Two thoughts:
>
> 1) In English at least, it's only at the trailing end of a word that the
> non-capitalization is clear (contractions, possessive, etc).
>
> 2) Proper names are unknowable as to what's appropriate and I posit that
> there is no algorithm that works for names.
>
> This leads to a conclusion: Never add capitalization inside a string of
> letters.

Interesting, but it worth breaking Oracle compatibility for it?

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +