Re: Counting the number of repeated phrases in a column

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Counting the number of repeated phrases in a column
Date: 2022-02-01 23:29:50
Message-ID: CA+i5JwYak0_Rr-TuzsOkRu+jDsFsgZJ7xdhFyDBbsw_X+WF4Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 25 Jan 2022 at 17:10, Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:

> There is a short of a function in the standard Postgres to do the
> following:
>
> It is easy to count the number of occurrence of words, but it is rather
> difficult to count the number of occurrence of phrases.
>
> For instance:
>
> A cell of value: 'Hello World' means 1 occurrence a phrase.
>
> A cell of value: 'Hello World World Hello' means no occurrence of any
> repeated phrase.
>
> But, A cell of value: 'Hello World World Hello Hello World' means 2
> occurrences of 'Hello World'.
>
> 'The City of London, London' also has no occurrences of any repeated
> phrase.
>
> Anyone has got such a function to check out the number of occurrence of
> any repeated phrases?
>
>
>
How about knock unique words into discrete joint up strings? Then check
whether there is any repeated words?
Regards,
David

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Abhishek Bhola 2022-02-02 02:26:06 Subscription stuck at initialize state
Previous Message Shaozhong SHI 2022-02-01 18:49:34 Re: Counting the number of repeated phrases in a column