pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Shaozhong SHI <shishaozhong@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Fault with initcap
Date: Tue, 12 Oct 2021 15:02:55 -0700
Message-ID: <157d10c3-a683-3373-3550-06113149cc51@aklaver.com> (raw)
In-Reply-To: <CA+i5JwYOMPrzNgX0eu6w+NFTObKf9NCiE3BKK2bS3nNd_=FfdA@mail.gmail.com>
References: <CA+i5JwZNEkm_geK6wSfc03D-qCaccOsW+_O2Dcc0h1VOBQfz2Q@mail.gmail.com>
	<CA+i5Jwb7gv4N9qfctixtJFEpEAdeb7yOU1zoZ-HsaQdwmbGEmg@mail.gmail.com>
	<10fbeda1-606a-553b-3598-eca814f40bb7@aklaver.com>
	<CA+i5JwYOMPrzNgX0eu6w+NFTObKf9NCiE3BKK2bS3nNd_=FfdA@mail.gmail.com>

On 10/12/21 13:50, Shaozhong SHI wrote:
> 
> 
> On Tue, 12 Oct 2021 at 20:34, Adrian Klaver <adrian.klaver@aklaver.com 

> 
>     Which follows the definition here:
> 
>     https://www.postgresql.org/docs/14/functions-string.html
>     <https://www.postgresql.org/docs/14/functions-string.html;
> 
>     initcap ( text ) → text
> 
>     Converts the first letter of each word to upper case and the rest to
>     lower case. Words are sequences of alphanumeric characters separated by
>     non-alphanumeric characters.
> 
>     Hi, Adrian Klaver,
> 
> 
> It looks like that you replicated the error.

There is no error, initcap is doing what it is documented to.

notemachine is not two words anymore then 'online', 'bluebell', 
'network' are.


> 
> There must be a way to do the following.

Maybe, but as Karsten says it would involve an AI. One that understands 
the mutt language that is English.

> 
> a column contains a list of words.  Only the first letter of each word 
> should be capitalised.  INITCAP can not do that.  How to create a 
> function just to capitalised each word (substring) in a list of 
> words/strings.  This will be very useful and create great impact.

 From here:

https://www.grammarly.com/blog/14-of-the-longest-words-in-english/

uncopyrightable

where would you split that into words?:

Some 'words' I see:

un
unc
copy
copyright
right
table
able

> 
> Regards,
> 
> David


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (19+ messages)  latest in thread

Message-ID: <157d10c3-a683-3373-3550-06113149cc51@aklaver.com>
Permalink:  ../157d10c3-a683-3373-3550-06113149cc51@aklaver.com/
Also on:    postgresql.org/message-id/157d10c3-a683-3373-3550-06113149cc51@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: adrian.klaver@aklaver.com, shishaozhong@gmail.com, pgsql-general@lists.postgresql.org
  Subject: Re: Fault with initcap
  In-Reply-To: <157d10c3-a683-3373-3550-06113149cc51@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox