|
| 1 | +-- Language-specific snowball dictionaries |
| 2 | +/* |
| 3 | + * Create underlying C functions for Snowball stemmers |
| 4 | + * |
| 5 | + * Copyright (c) 2007-2018, PostgreSQL Global Development Group |
| 6 | + * |
| 7 | + * contrib/snowball_ext/snowball_ext_func.sql.in |
| 8 | + * |
| 9 | + * This file is combined with multiple instances of snowball_ext.sql.in to |
| 10 | + * build snowball_ext--1.0.sql. |
| 11 | + * |
| 12 | + * Note: this file is read in single-user -j mode, which means that the |
| 13 | + * command terminator is semicolon-newline-newline; whenever the backend |
| 14 | + * sees that, it stops and executes what it's got. If you write a lot of |
| 15 | + * statements without empty lines between, they'll all get quoted to you |
| 16 | + * in any error message about one of them, so don't do that. Also, you |
| 17 | + * cannot write a semicolon immediately followed by an empty line in a |
| 18 | + * string literal (including a function body!) or a multiline comment. |
| 19 | + */ |
| 20 | + |
| 21 | +CREATE FUNCTION dsnowball_ext_init(INTERNAL) |
| 22 | + RETURNS INTERNAL AS 'MODULE_PATHNAME', 'dsnowball_ext_init' |
| 23 | +LANGUAGE C STRICT; |
| 24 | + |
| 25 | +CREATE FUNCTION dsnowball_ext_lexize(INTERNAL, INTERNAL, INTERNAL, INTERNAL) |
| 26 | + RETURNS INTERNAL AS 'MODULE_PATHNAME', 'dsnowball_ext_lexize' |
| 27 | +LANGUAGE C STRICT; |
| 28 | + |
| 29 | +CREATE TEXT SEARCH TEMPLATE snowball_ext |
| 30 | + (INIT = dsnowball_ext_init, |
| 31 | + LEXIZE = dsnowball_ext_lexize); |
| 32 | + |
| 33 | +COMMENT ON TEXT SEARCH TEMPLATE snowball_ext IS 'snowball stemmer'; |
| 34 | +/* |
| 35 | + * text search configuration for nepali language |
| 36 | + * |
| 37 | + * Copyright (c) 2007-2018, PostgreSQL Global Development Group |
| 38 | + * |
| 39 | + * contrib/snowball_ext/snowball_ext.sql.in |
| 40 | + * |
| 41 | + * nepali and certain other macros are replaced for each language; |
| 42 | + * see the Makefile for details. |
| 43 | + * |
| 44 | + * Note: this file is read in single-user -j mode, which means that the |
| 45 | + * command terminator is semicolon-newline-newline; whenever the backend |
| 46 | + * sees that, it stops and executes what it's got. If you write a lot of |
| 47 | + * statements without empty lines between, they'll all get quoted to you |
| 48 | + * in any error message about one of them, so don't do that. Also, you |
| 49 | + * cannot write a semicolon immediately followed by an empty line in a |
| 50 | + * string literal (including a function body!) or a multiline comment. |
| 51 | + */ |
| 52 | + |
| 53 | +CREATE TEXT SEARCH DICTIONARY nepali_stem |
| 54 | + (TEMPLATE = snowball_ext, Language = nepali ); |
| 55 | + |
| 56 | +COMMENT ON TEXT SEARCH DICTIONARY nepali_stem IS 'snowball stemmer for nepali language'; |
| 57 | + |
| 58 | +CREATE TEXT SEARCH CONFIGURATION nepali |
| 59 | + (PARSER = default); |
| 60 | + |
| 61 | +COMMENT ON TEXT SEARCH CONFIGURATION nepali IS 'configuration for nepali language'; |
| 62 | + |
| 63 | +ALTER TEXT SEARCH CONFIGURATION nepali ADD MAPPING |
| 64 | + FOR email, url, url_path, host, file, version, |
| 65 | + sfloat, float, int, uint, |
| 66 | + numword, hword_numpart, numhword |
| 67 | + WITH simple; |
| 68 | + |
| 69 | +ALTER TEXT SEARCH CONFIGURATION nepali ADD MAPPING |
| 70 | + FOR asciiword, hword_asciipart, asciihword |
| 71 | + WITH nepali_stem; |
| 72 | + |
| 73 | +ALTER TEXT SEARCH CONFIGURATION nepali ADD MAPPING |
| 74 | + FOR word, hword_part, hword |
| 75 | + WITH nepali_stem; |
0 commit comments