Giter Site home page Giter Site logo

hunspell_dicts's Introduction

Hunspell dictionaries

Introduction

The repository contains hunspell dictionaries for german, english, french, dutch, norwegian and russian languages.

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):

  • OpenOffice/LibreOffice extension files have the .oxt extension. It is necessary to extract .aff and .dic files, change extensions to .affix and .dict. For some dictionary files it is also needed to convert characters to the UTF-8 encoding with commands (for example, for a Norwegian language dictionary):
iconv -f ISO_8859-1 -t UTF-8 -o nn_no.affix nn_NO.aff
iconv -f ISO_8859-1 -t UTF-8 -o nn_no.dict nn_NO.dic
  • copy files to the $SHAREDIR/tsearch_data directory
  • load files into PostgreSQL with the following command:
CREATE TEXT SEARCH DICTIONARY norwegian_hunspell (
    TEMPLATE = ispell,
    DictFile = nn_no,
    AffFile = nn_no,
    StopWords = norwegian
);

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

hunspell_dicts's People

Contributors

za-arthur avatar

Stargazers

Georgy Shelkovy avatar

Watchers

James Cloos avatar Georgy Shelkovy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.