Обсуждение: [GENERAL] Spelling dictionaries

Поиск
Список
Период
Сортировка

[GENERAL] Spelling dictionaries

От
hmidi slim
Дата:
Hi,
I'm using Full Text search and I'm interested on using spelling dictionary.
I found a website that has a special functionality, for example when I enter the word 'activities' it gives me the suggestions containing this word. But when I enter the word 'activityns' it returns 'No result for 'activityns'' But it gives me some suggestions contained the word 'activities'.
In cas I entered the word 'activityng' it returns the same message 'No result for 'activityng' ' But I got some suggestions containing the word 'activity'.
Does this the behaviour of the lspell dictionary, because I didn't understand how does he give suggestions when the word is wrong.

Re: [GENERAL] Spelling dictionaries

От
Arthur Zakirov
Дата:
On Fri, Nov 10, 2017 at 10:16:06AM +0100, hmidi slim wrote:
> Hi,
> I'm using Full Text search and I'm interested on using spelling dictionary.
> I found a website that has a special functionality, for example when I
> enter the word 'activities' it gives me the suggestions containing this
> word. But when I enter the word 'activityns' it returns 'No result for
> 'activityns'' But it gives me some suggestions contained the word
> 'activities'.
> In cas I entered the word 'activityng' it returns the same message 'No
> result for 'activityng' ' But I got some suggestions containing the word
> 'activity'.
> Does this the behaviour of the lspell dictionary, because I didn't
> understand how does he give suggestions when the word is wrong.

You can try pg_trgm extension [1].

Also we have a little demo web-site [2]. It uses pg_trgm. You can look at its code [3].


1 - https://www.postgresql.org/docs/current/static/pgtrgm.html#idm46428634444576
2 - http://tsdemo.postgrespro.ru/search?pattern=Galaksy&order=rank&rank_func=ts_rank
3 - https://github.com/postgrespro/apod_fts/blob/master/apod.py

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Spelling dictionaries

От
hmidi slim
Дата:
What about pg_similarity https://github.com/eulerto/pg_similarity. Do you have any idea about this?

2017-11-10 10:36 GMT+01:00 Arthur Zakirov <a.zakirov@postgrespro.ru>:
On Fri, Nov 10, 2017 at 10:16:06AM +0100, hmidi slim wrote:
> Hi,
> I'm using Full Text search and I'm interested on using spelling dictionary.
> I found a website that has a special functionality, for example when I
> enter the word 'activities' it gives me the suggestions containing this
> word. But when I enter the word 'activityns' it returns 'No result for
> 'activityns'' But it gives me some suggestions contained the word
> 'activities'.
> In cas I entered the word 'activityng' it returns the same message 'No
> result for 'activityng' ' But I got some suggestions containing the word
> 'activity'.
> Does this the behaviour of the lspell dictionary, because I didn't
> understand how does he give suggestions when the word is wrong.

You can try pg_trgm extension [1].

Also we have a little demo web-site [2]. It uses pg_trgm. You can look at its code [3].


1 - https://www.postgresql.org/docs/current/static/pgtrgm.html#idm46428634444576
2 - http://tsdemo.postgrespro.ru/search?pattern=Galaksy&order=rank&rank_func=ts_rank
3 - https://github.com/postgrespro/apod_fts/blob/master/apod.py

--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company