postgrespro / hunspell_dicts

Hunspell dictionaries for PostgreSQL
Other
63 stars 17 forks source link

Hunspell dictionaries

Introduction

The repository contains hunspell dictionaries for several languages listed below.

Installation

Here the example of installation of the english dictionary:

$ git clone https://github.com/postgrespro/hunspell_dicts
$ cd hunspell_dicts/hunspell_en_us
$ make USE_PGXS=1 install
$ make USE_PGXS=1 installcheck
$ psql DB -c "CREATE EXTENSION hunspell_en_us;"

Important: Don't forget to set the PG_CONFIG variable in case you want to test dictionaries on a custom build of PostgreSQL. Read more here.

After the installation you can use english dictionary and configuration:

=> SELECT ts_lexize('english_hunspell', 'stories');
 ts_lexize
-----------
 {story}
(1 row)

=> SELECT to_tsvector('english_hunspell', 'stories');
 to_tsvector
-------------
 'story':1
(1 row)

Custom installation

If you want to create a dictionary which isn't listed below, you may want to download necessary OpenOffice or LibreOffice extension.

Then you need to do the following (from the documentation):

New dictionaries and configurations

The modules introduce the following dictionaries and configurations:

Module Dictionary/Configuration
hunspell_cs_cz czech_hunspell
hunspell_de_de german_hunspell
hunspell_en_us english_hunspell
hunspell_fr french_hunspell
hunspell_ne_np nepali_hunspell
hunspell_nl_nl dutch_hunspell
hunspell_nn_no norwegian_hunspell
hunspell_pt_pt portuguese_hunspell
hunspell_ru_ru russian_hunspell
hunspell_ru_ru_aot russian_aot_hunspell