{"Entry":{"collection":"fts","key":"template-ispell","name":"ispell","aliases":[],"metadata":{"aliases":[],"category":"Dictionary templates","content_hash":"6ad07a4e3be807dbbc33ce31726995d9cfbb3a7c886ede62b5582a35a1863896","imported_at":"2026-09-30T00:40:47.658269+08:00","name":"ispell","name_zh":"","slug":"template-ispell","summary":"ispell dictionary"}},"Definition":{"Collection":"fts","Key":"template-ispell","SourceDatabase":"center","Version":"18","SourceTable":"text_search_component","SourceKey":"template-ispell","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"aliases":[],"attributes":{"tmplinit":"dispell_init","tmpllexize":"dispell_lexize","tmplname":"ispell"},"comparison_data":{"tmplinit":"dispell_init","tmpllexize":"dispell_lexize","tmplname":"ispell"},"comparison_hash":"8b7d546e289f525321c9b7a6612c5fe0397f3f32c93ab170f863a07763c524b0","description":["ispell dictionary"],"facts":[{"label":"Tmplname","value":"ispell"},{"label":"Tmplinit","value":"dispell_init"},{"label":"Tmpllexize","value":"dispell_lexize"}],"manual_html":"\u003cdiv class=\"sect2\" id=\"TEXTSEARCH-ISPELL-DICTIONARY\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch3 class=\"title\"\u003e12.6.5. \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e Dictionary \u003c/h3\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary template supports \u003cem class=\"firstterm\"\u003emorphological dictionaries\u003c/em\u003e, which can normalize many different linguistic forms of a word into the same lexeme. For example, an English \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary can match all declensions and conjugations of the search term \u003ccode class=\"literal\"\u003ebank\u003c/code\u003e, e.g., \u003ccode class=\"literal\"\u003ebanking\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanked\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanks\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanks'\u003c/code\u003e, and \u003ccode class=\"literal\"\u003ebank's\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe standard \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e distribution does not include any \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e configuration files. Dictionaries for a large number of languages are available from \u003ca class=\"ulink\" href=\"https://www.cs.hmc.edu/~geoff/ispell.html\"\u003eIspell\u003c/a\u003e. Also, some more modern dictionary file formats are supported — \u003ca class=\"ulink\" href=\"https://en.wikipedia.org/wiki/MySpell\"\u003eMySpell\u003c/a\u003e (OO \u0026lt; 2.0.1) and \u003ca class=\"ulink\" href=\"https://hunspell.github.io/\"\u003eHunspell\u003c/a\u003e (OO \u0026gt;= 2.0.2). A large list of dictionaries is available on the \u003ca class=\"ulink\" href=\"https://wiki.openoffice.org/wiki/Dictionaries\"\u003eOpenOffice Wiki\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eTo create an \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary perform these steps:\u003c/p\u003e\n\u003cdiv class=\"itemizedlist\"\u003e\n\u003cul class=\"itemizedlist compact\"\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003edownload dictionary configuration files. \u003cspan class=\"productname\"\u003eOpenOffice\u003c/span\u003e extension files have the \u003ccode class=\"filename\"\u003e.oxt\u003c/code\u003e extension. It is necessary to extract \u003ccode class=\"filename\"\u003e.aff\u003c/code\u003e and \u003ccode class=\"filename\"\u003e.dic\u003c/code\u003e files, change extensions to \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e and \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e. 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):\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eiconv -f ISO_8859-1 -t UTF-8 -o nn_no.affix nn_NO.aff\niconv -f ISO_8859-1 -t UTF-8 -o nn_no.dict nn_NO.dic\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003ecopy files to the \u003ccode class=\"filename\"\u003e$SHAREDIR/tsearch_data\u003c/code\u003e directory\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eload files into PostgreSQL with the following command:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eCREATE TEXT SEARCH DICTIONARY english_hunspell (\n    TEMPLATE = ispell,\n    DictFile = en_us,\n    AffFile = en_us,\n    Stopwords = english);\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eHere, \u003ccode class=\"literal\"\u003eDictFile\u003c/code\u003e, \u003ccode class=\"literal\"\u003eAffFile\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eStopWords\u003c/code\u003e specify the base names of the dictionary, affixes, and stop-words files. The stop-words file has the same format explained above for the \u003ccode class=\"literal\"\u003esimple\u003c/code\u003e dictionary type. The format of the other files is not specified here but is available from the above-mentioned web sites.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries usually recognize a limited set of words, so they should be followed by another broader dictionary; for example, a Snowball dictionary, which recognizes everything.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file of \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eprefixes\nflag *A:\n    .           \u0026gt;   RE      # As in enter \u0026gt; reenter\nsuffixes\nflag T:\n    E           \u0026gt;   ST      # As in late \u0026gt; latest\n    [^AEIOU]Y   \u0026gt;   -Y,IEST # As in dirty \u0026gt; dirtiest\n    [AEIOU]Y    \u0026gt;   EST     # As in gray \u0026gt; grayest\n    [^EY]       \u0026gt;   EST     # As in small \u0026gt; smallest\n\u003c/pre\u003e\n\u003cp\u003eAnd the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003elapse/ADGRS\nlard/DGRS\nlarge/PRTY\nlark/MRS\n\u003c/pre\u003e\n\u003cp\u003eFormat of the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file is:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ebasic_form/affix_class_name\n\u003c/pre\u003e\n\u003cp\u003eIn the \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file every affix flag is described in the following format:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003econdition \u0026gt; [-stripping_letters,] adding_affix\n\u003c/pre\u003e\n\u003cp\u003eHere, condition has a format similar to the format of regular expressions. It can use groupings \u003ccode class=\"literal\"\u003e[...]\u003c/code\u003e and \u003ccode class=\"literal\"\u003e[^...]\u003c/code\u003e. For example, \u003ccode class=\"literal\"\u003e[AEIOU]Y\u003c/code\u003e means that the last letter of the word is \u003ccode class=\"literal\"\u003e\"y\"\u003c/code\u003e and the penultimate letter is \u003ccode class=\"literal\"\u003e\"a\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"e\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"i\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"o\"\u003c/code\u003e or \u003ccode class=\"literal\"\u003e\"u\"\u003c/code\u003e. \u003ccode class=\"literal\"\u003e[^EY]\u003c/code\u003e means that the last letter is neither \u003ccode class=\"literal\"\u003e\"e\"\u003c/code\u003e nor \u003ccode class=\"literal\"\u003e\"y\"\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries support splitting compound words; a useful feature. Notice that the affix file should specify a special flag using the \u003ccode class=\"literal\"\u003ecompoundwords controlled\u003c/code\u003e statement that marks dictionary words that can participate in compound formation:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ecompoundwords  controlled z\n\u003c/pre\u003e\n\u003cp\u003eHere are some examples for the Norwegian language:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT ts_lexize('norwegian_ispell', 'overbuljongterningpakkmesterassistent');\n   {over,buljong,terning,pakk,mester,assistent}\nSELECT ts_lexize('norwegian_ispell', 'sjokoladefabrikk');\n   {sjokoladefabrikk,sjokolade,fabrikk}\n\u003c/pre\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eMySpell\u003c/span\u003e format is a subset of \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e. The \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file of \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ePFX A Y 1\nPFX A   0     re         .\nSFX T N 4\nSFX T   0     st         e\nSFX T   y     iest       [^aeiou]y\nSFX T   0     est        [aeiou]y\nSFX T   0     est        [^ey]\n\u003c/pre\u003e\n\u003cp\u003eThe first line of an affix class is the header. Fields of an affix rules are listed after the header:\u003c/p\u003e\n\u003cdiv class=\"itemizedlist\"\u003e\n\u003cul class=\"itemizedlist compact\"\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eparameter name (PFX or SFX)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eflag (name of the affix class)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003estripping characters from beginning (at prefix) or end (at suffix) of the word\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eadding affix\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003econdition that has a format similar to the format of regular expressions.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file looks like the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file of \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003elarder/M\nlardy/RT\nlarge/RSPMYT\nlargehearted\n\u003c/pre\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eMySpell\u003c/span\u003e does not support compound words. \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e has sophisticated support for compound words. At present, \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e implements only the basic compound word operations of Hunspell.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","manual_path":"/docs/18/textsearch-dictionaries.html#TEXTSEARCH-ISPELL-DICTIONARY","related":[],"release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"","sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"textsearch-dictionaries.html","sha256":"736b212545d12542777fa6d106bbf5b159fe5617123a208d36a8a572130c3fa6","url":"/docs/18/textsearch-dictionaries.html#TEXTSEARCH-ISPELL-DICTIONARY"}],"tables":[]},"ManualEvidence":{"manual_path":"/docs/18/textsearch-dictionaries.html#TEXTSEARCH-ISPELL-DICTIONARY","release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"textsearch-dictionaries.html","sha256":"736b212545d12542777fa6d106bbf5b159fe5617123a208d36a8a572130c3fa6","url":"/docs/18/textsearch-dictionaries.html#TEXTSEARCH-ISPELL-DICTIONARY"}]},"MeasuredEvidence":{}},"Text":{"Collection":"fts","Key":"template-ispell","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ispell","Summary":"ispell dictionary","BodyHTML":"\u003cdiv id=\"TEXTSEARCH-ISPELL-DICTIONARY\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch3\u003e12.6.5. \u003cspan\u003eIspell\u003c/span\u003e Dictionary \u003c/h3\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003cspan\u003eIspell\u003c/span\u003e dictionary template supports \u003cem\u003emorphological dictionaries\u003c/em\u003e, which can normalize many different linguistic forms of a word into the same lexeme. For example, an English \u003cspan\u003eIspell\u003c/span\u003e dictionary can match all declensions and conjugations of the search term \u003ccode\u003ebank\u003c/code\u003e, e.g., \u003ccode\u003ebanking\u003c/code\u003e, \u003ccode\u003ebanked\u003c/code\u003e, \u003ccode\u003ebanks\u003c/code\u003e, \u003ccode\u003ebanks\u0026#39;\u003c/code\u003e, and \u003ccode\u003ebank\u0026#39;s\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe standard \u003cspan\u003ePostgreSQL\u003c/span\u003e distribution does not include any \u003cspan\u003eIspell\u003c/span\u003e configuration files. Dictionaries for a large number of languages are available from \u003ca href=\"https://www.cs.hmc.edu/~geoff/ispell.html\" rel=\"nofollow\"\u003eIspell\u003c/a\u003e. Also, some more modern dictionary file formats are supported — \u003ca href=\"https://en.wikipedia.org/wiki/MySpell\" rel=\"nofollow\"\u003eMySpell\u003c/a\u003e (OO \u0026lt; 2.0.1) and \u003ca href=\"https://hunspell.github.io/\" rel=\"nofollow\"\u003eHunspell\u003c/a\u003e (OO \u0026gt;= 2.0.2). A large list of dictionaries is available on the \u003ca href=\"https://wiki.openoffice.org/wiki/Dictionaries\" rel=\"nofollow\"\u003eOpenOffice Wiki\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eTo create an \u003cspan\u003eIspell\u003c/span\u003e dictionary perform these steps:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003edownload dictionary configuration files. \u003cspan\u003eOpenOffice\u003c/span\u003e extension files have the \u003ccode\u003e.oxt\u003c/code\u003e extension. It is necessary to extract \u003ccode\u003e.aff\u003c/code\u003e and \u003ccode\u003e.dic\u003c/code\u003e files, change extensions to \u003ccode\u003e.affix\u003c/code\u003e and \u003ccode\u003e.dict\u003c/code\u003e. 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):\u003c/p\u003e\n\u003cpre\u003eiconv -f ISO_8859-1 -t UTF-8 -o nn_no.affix nn_NO.aff\niconv -f ISO_8859-1 -t UTF-8 -o nn_no.dict nn_NO.dic\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003ecopy files to the \u003ccode\u003e$SHAREDIR/tsearch_data\u003c/code\u003e directory\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eload files into PostgreSQL with the following command:\u003c/p\u003e\n\u003cpre\u003eCREATE TEXT SEARCH DICTIONARY english_hunspell (\n    TEMPLATE = ispell,\n    DictFile = en_us,\n    AffFile = en_us,\n    Stopwords = english);\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eHere, \u003ccode\u003eDictFile\u003c/code\u003e, \u003ccode\u003eAffFile\u003c/code\u003e, and \u003ccode\u003eStopWords\u003c/code\u003e specify the base names of the dictionary, affixes, and stop-words files. The stop-words file has the same format explained above for the \u003ccode\u003esimple\u003c/code\u003e dictionary type. The format of the other files is not specified here but is available from the above-mentioned web sites.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries usually recognize a limited set of words, so they should be followed by another broader dictionary; for example, a Snowball dictionary, which recognizes everything.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003e.affix\u003c/code\u003e file of \u003cspan\u003eIspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre\u003eprefixes\nflag *A:\n    .           \u0026gt;   RE      # As in enter \u0026gt; reenter\nsuffixes\nflag T:\n    E           \u0026gt;   ST      # As in late \u0026gt; latest\n    [^AEIOU]Y   \u0026gt;   -Y,IEST # As in dirty \u0026gt; dirtiest\n    [AEIOU]Y    \u0026gt;   EST     # As in gray \u0026gt; grayest\n    [^EY]       \u0026gt;   EST     # As in small \u0026gt; smallest\n\u003c/pre\u003e\n\u003cp\u003eAnd the \u003ccode\u003e.dict\u003c/code\u003e file has the following structure:\u003c/p\u003e\n\u003cpre\u003elapse/ADGRS\nlard/DGRS\nlarge/PRTY\nlark/MRS\n\u003c/pre\u003e\n\u003cp\u003eFormat of the \u003ccode\u003e.dict\u003c/code\u003e file is:\u003c/p\u003e\n\u003cpre\u003ebasic_form/affix_class_name\n\u003c/pre\u003e\n\u003cp\u003eIn the \u003ccode\u003e.affix\u003c/code\u003e file every affix flag is described in the following format:\u003c/p\u003e\n\u003cpre\u003econdition \u0026gt; [-stripping_letters,] adding_affix\n\u003c/pre\u003e\n\u003cp\u003eHere, condition has a format similar to the format of regular expressions. It can use groupings \u003ccode\u003e[...]\u003c/code\u003e and \u003ccode\u003e[^...]\u003c/code\u003e. For example, \u003ccode\u003e[AEIOU]Y\u003c/code\u003e means that the last letter of the word is \u003ccode\u003e\u0026#34;y\u0026#34;\u003c/code\u003e and the penultimate letter is \u003ccode\u003e\u0026#34;a\u0026#34;\u003c/code\u003e, \u003ccode\u003e\u0026#34;e\u0026#34;\u003c/code\u003e, \u003ccode\u003e\u0026#34;i\u0026#34;\u003c/code\u003e, \u003ccode\u003e\u0026#34;o\u0026#34;\u003c/code\u003e or \u003ccode\u003e\u0026#34;u\u0026#34;\u003c/code\u003e. \u003ccode\u003e[^EY]\u003c/code\u003e means that the last letter is neither \u003ccode\u003e\u0026#34;e\u0026#34;\u003c/code\u003e nor \u003ccode\u003e\u0026#34;y\u0026#34;\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries support splitting compound words; a useful feature. Notice that the affix file should specify a special flag using the \u003ccode\u003ecompoundwords controlled\u003c/code\u003e statement that marks dictionary words that can participate in compound formation:\u003c/p\u003e\n\u003cpre\u003ecompoundwords  controlled z\n\u003c/pre\u003e\n\u003cp\u003eHere are some examples for the Norwegian language:\u003c/p\u003e\n\u003cpre\u003eSELECT ts_lexize(\u0026#39;norwegian_ispell\u0026#39;, \u0026#39;overbuljongterningpakkmesterassistent\u0026#39;);\n   {over,buljong,terning,pakk,mester,assistent}\nSELECT ts_lexize(\u0026#39;norwegian_ispell\u0026#39;, \u0026#39;sjokoladefabrikk\u0026#39;);\n   {sjokoladefabrikk,sjokolade,fabrikk}\n\u003c/pre\u003e\n\u003cp\u003e\u003cspan\u003eMySpell\u003c/span\u003e format is a subset of \u003cspan\u003eHunspell\u003c/span\u003e. The \u003ccode\u003e.affix\u003c/code\u003e file of \u003cspan\u003eHunspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre\u003ePFX A Y 1\nPFX A   0     re         .\nSFX T N 4\nSFX T   0     st         e\nSFX T   y     iest       [^aeiou]y\nSFX T   0     est        [aeiou]y\nSFX T   0     est        [^ey]\n\u003c/pre\u003e\n\u003cp\u003eThe first line of an affix class is the header. Fields of an affix rules are listed after the header:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eparameter name (PFX or SFX)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eflag (name of the affix class)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003estripping characters from beginning (at prefix) or end (at suffix) of the word\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eadding affix\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003econdition that has a format similar to the format of regular expressions.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003ccode\u003e.dict\u003c/code\u003e file looks like the \u003ccode\u003e.dict\u003c/code\u003e file of \u003cspan\u003eIspell\u003c/span\u003e:\u003c/p\u003e\n\u003cpre\u003elarder/M\nlardy/RT\nlarge/RSPMYT\nlargehearted\n\u003c/pre\u003e\n\u003cdiv\u003e\n\u003ch3\u003eNote\u003c/h3\u003e\n\u003cp\u003e\u003cspan\u003eMySpell\u003c/span\u003e does not support compound words. \u003cspan\u003eHunspell\u003c/span\u003e has sophisticated support for compound words. At present, \u003cspan\u003ePostgreSQL\u003c/span\u003e implements only the basic compound word operations of Hunspell.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"b1ad9b6751938aba0352c57a7f1bd359eb25d9d7ad809888a43863c191ddc727","Payload":{"description":["ispell dictionary"],"manual_html":"\u003cdiv class=\"sect2\" id=\"TEXTSEARCH-ISPELL-DICTIONARY\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch3 class=\"title\"\u003e12.6.5. \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e Dictionary \u003c/h3\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary template supports \u003cem class=\"firstterm\"\u003emorphological dictionaries\u003c/em\u003e, which can normalize many different linguistic forms of a word into the same lexeme. For example, an English \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary can match all declensions and conjugations of the search term \u003ccode class=\"literal\"\u003ebank\u003c/code\u003e, e.g., \u003ccode class=\"literal\"\u003ebanking\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanked\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanks\u003c/code\u003e, \u003ccode class=\"literal\"\u003ebanks'\u003c/code\u003e, and \u003ccode class=\"literal\"\u003ebank's\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe standard \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e distribution does not include any \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e configuration files. Dictionaries for a large number of languages are available from \u003ca class=\"ulink\" href=\"https://www.cs.hmc.edu/~geoff/ispell.html\"\u003eIspell\u003c/a\u003e. Also, some more modern dictionary file formats are supported — \u003ca class=\"ulink\" href=\"https://en.wikipedia.org/wiki/MySpell\"\u003eMySpell\u003c/a\u003e (OO \u0026lt; 2.0.1) and \u003ca class=\"ulink\" href=\"https://hunspell.github.io/\"\u003eHunspell\u003c/a\u003e (OO \u0026gt;= 2.0.2). A large list of dictionaries is available on the \u003ca class=\"ulink\" href=\"https://wiki.openoffice.org/wiki/Dictionaries\"\u003eOpenOffice Wiki\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eTo create an \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e dictionary perform these steps:\u003c/p\u003e\n\u003cdiv class=\"itemizedlist\"\u003e\n\u003cul class=\"itemizedlist compact\"\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003edownload dictionary configuration files. \u003cspan class=\"productname\"\u003eOpenOffice\u003c/span\u003e extension files have the \u003ccode class=\"filename\"\u003e.oxt\u003c/code\u003e extension. It is necessary to extract \u003ccode class=\"filename\"\u003e.aff\u003c/code\u003e and \u003ccode class=\"filename\"\u003e.dic\u003c/code\u003e files, change extensions to \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e and \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e. 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):\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eiconv -f ISO_8859-1 -t UTF-8 -o nn_no.affix nn_NO.aff\niconv -f ISO_8859-1 -t UTF-8 -o nn_no.dict nn_NO.dic\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003ecopy files to the \u003ccode class=\"filename\"\u003e$SHAREDIR/tsearch_data\u003c/code\u003e directory\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eload files into PostgreSQL with the following command:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eCREATE TEXT SEARCH DICTIONARY english_hunspell (\n    TEMPLATE = ispell,\n    DictFile = en_us,\n    AffFile = en_us,\n    Stopwords = english);\n\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eHere, \u003ccode class=\"literal\"\u003eDictFile\u003c/code\u003e, \u003ccode class=\"literal\"\u003eAffFile\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eStopWords\u003c/code\u003e specify the base names of the dictionary, affixes, and stop-words files. The stop-words file has the same format explained above for the \u003ccode class=\"literal\"\u003esimple\u003c/code\u003e dictionary type. The format of the other files is not specified here but is available from the above-mentioned web sites.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries usually recognize a limited set of words, so they should be followed by another broader dictionary; for example, a Snowball dictionary, which recognizes everything.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file of \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eprefixes\nflag *A:\n    .           \u0026gt;   RE      # As in enter \u0026gt; reenter\nsuffixes\nflag T:\n    E           \u0026gt;   ST      # As in late \u0026gt; latest\n    [^AEIOU]Y   \u0026gt;   -Y,IEST # As in dirty \u0026gt; dirtiest\n    [AEIOU]Y    \u0026gt;   EST     # As in gray \u0026gt; grayest\n    [^EY]       \u0026gt;   EST     # As in small \u0026gt; smallest\n\u003c/pre\u003e\n\u003cp\u003eAnd the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003elapse/ADGRS\nlard/DGRS\nlarge/PRTY\nlark/MRS\n\u003c/pre\u003e\n\u003cp\u003eFormat of the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file is:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ebasic_form/affix_class_name\n\u003c/pre\u003e\n\u003cp\u003eIn the \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file every affix flag is described in the following format:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003econdition \u0026gt; [-stripping_letters,] adding_affix\n\u003c/pre\u003e\n\u003cp\u003eHere, condition has a format similar to the format of regular expressions. It can use groupings \u003ccode class=\"literal\"\u003e[...]\u003c/code\u003e and \u003ccode class=\"literal\"\u003e[^...]\u003c/code\u003e. For example, \u003ccode class=\"literal\"\u003e[AEIOU]Y\u003c/code\u003e means that the last letter of the word is \u003ccode class=\"literal\"\u003e\"y\"\u003c/code\u003e and the penultimate letter is \u003ccode class=\"literal\"\u003e\"a\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"e\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"i\"\u003c/code\u003e, \u003ccode class=\"literal\"\u003e\"o\"\u003c/code\u003e or \u003ccode class=\"literal\"\u003e\"u\"\u003c/code\u003e. \u003ccode class=\"literal\"\u003e[^EY]\u003c/code\u003e means that the last letter is neither \u003ccode class=\"literal\"\u003e\"e\"\u003c/code\u003e nor \u003ccode class=\"literal\"\u003e\"y\"\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIspell dictionaries support splitting compound words; a useful feature. Notice that the affix file should specify a special flag using the \u003ccode class=\"literal\"\u003ecompoundwords controlled\u003c/code\u003e statement that marks dictionary words that can participate in compound formation:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ecompoundwords  controlled z\n\u003c/pre\u003e\n\u003cp\u003eHere are some examples for the Norwegian language:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT ts_lexize('norwegian_ispell', 'overbuljongterningpakkmesterassistent');\n   {over,buljong,terning,pakk,mester,assistent}\nSELECT ts_lexize('norwegian_ispell', 'sjokoladefabrikk');\n   {sjokoladefabrikk,sjokolade,fabrikk}\n\u003c/pre\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eMySpell\u003c/span\u003e format is a subset of \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e. The \u003ccode class=\"filename\"\u003e.affix\u003c/code\u003e file of \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e has the following structure:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003ePFX A Y 1\nPFX A   0     re         .\nSFX T N 4\nSFX T   0     st         e\nSFX T   y     iest       [^aeiou]y\nSFX T   0     est        [aeiou]y\nSFX T   0     est        [^ey]\n\u003c/pre\u003e\n\u003cp\u003eThe first line of an affix class is the header. Fields of an affix rules are listed after the header:\u003c/p\u003e\n\u003cdiv class=\"itemizedlist\"\u003e\n\u003cul class=\"itemizedlist compact\"\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eparameter name (PFX or SFX)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eflag (name of the affix class)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003estripping characters from beginning (at prefix) or end (at suffix) of the word\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003eadding affix\u003c/p\u003e\n\u003c/li\u003e\n\u003cli class=\"listitem\"\u003e\n\u003cp\u003econdition that has a format similar to the format of regular expressions.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003eThe \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file looks like the \u003ccode class=\"filename\"\u003e.dict\u003c/code\u003e file of \u003cspan class=\"application\"\u003eIspell\u003c/span\u003e:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003elarder/M\nlardy/RT\nlarge/RSPMYT\nlargehearted\n\u003c/pre\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eMySpell\u003c/span\u003e does not support compound words. \u003cspan class=\"application\"\u003eHunspell\u003c/span\u003e has sophisticated support for compound words. At present, \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e implements only the basic compound word operations of Hunspell.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","related":[],"sections":[],"tables":[]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
