You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This dictionary normalizes input word into lexems and replaces them with groupsof their translations.
Installation
Here the example of installation of the module:
$ git clone https://github.com/select-artur/dict_translate$ cd dict_translate$ make USE_PGXS=1$ sudo make USE_PGXS=1 install$ make USE_PGXS=1 installcheck$ psql DB -c "CREATE EXTENSION dict_translate;"
Usage
You can use this template in the following way.
Create the file $SHAREDIR/tsearch_data/test_trn.trn:
$ forest wald forst holz$ home haus heim
Create text search dictionary and configuration:
=> CREATETEXT SEARCH DICTIONARY test_trn ( Template=translate, DictFile= test_trn, InputDict=pg_catalog.english_stem);=> CREATETEXT SEARCH CONFIGURATION test_cfg(COPY='simple');=> ALTERTEXT SEARCH CONFIGURATION test_cfg ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, word, hword, hword_part WITH test_trn, english_stem;
You can test this dictionary using this table:
=> CREATE TABLE test (ttext);=>INSERT INTO testVALUES ('homes'), ('home'), ('forest'), ('haus');
Query examples:
=>SELECT*FROM testWHERE to_tsvector('test_cfg', t) @@ to_tsquery('test_cfg','forests'); t--------forest(1 row)=>SELECT*FROM testWHERE to_tsvector('test_cfg', t) @@ to_tsquery('test_cfg','home'); t------- homes home haus(3 rows)