1
+ include_directories (
2
+ "${PROJECT_SOURCE_DIR} /src/include/snowball"
3
+ "${PROJECT_SOURCE_DIR} /src/include/snowball/libstemmer"
4
+ )
5
+
6
+ set (snow_languages
7
+ "danish\; danish"
8
+ "dutch\; dutch"
9
+ "english\; english"
10
+ "finnish\; finnish"
11
+ "french\; french"
12
+ "german\; german"
13
+ "hungarian\; hungarian"
14
+ "italian\; italian"
15
+ "norwegian\; norwegian"
16
+ "portuguese\; portuguese"
17
+ "romanian\; romanian"
18
+ "russian\; english"
19
+ "spanish\; spanish"
20
+ "swedish\; swedish"
21
+ "turkish\; turkish"
22
+ )
23
+
24
+ #Create snowball_create.sql
25
+ file (STRINGS snowball.sql.in snowball_sql_tmpl NEWLINE_CONSUME )
26
+ file (READ snowball_func.sql.in snowball_func_sql_tmpl )
27
+
28
+ file (WRITE "snowball_create.sql" ${snowball_func_sql_tmpl} )
29
+
30
+ foreach (pair_language ${snow_languages} )
31
+ LIST (GET pair_language 0 lang )
32
+ LIST (GET pair_language 1 ascii_lang )
33
+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /stopwords/${lang} .stop" )
34
+ set (stopwords ", StopWords=${lang} " )
35
+ else ()
36
+ set (stopwords "" )
37
+ endif ()
38
+ string (REPLACE "_LANGNAME_"
39
+ "${lang} " out_string
40
+ "${snowball_sql_tmpl} " )
41
+ string (REPLACE "_DICTNAME_"
42
+ "${lang} _stem" out_string
43
+ "${out_string} " )
44
+ string (REPLACE "_CFGNAME_"
45
+ "${lang} " out_string
46
+ "${out_string} " )
47
+ string (REPLACE "_ASCDICTNAME_"
48
+ "${ascii_lang} _stem" out_string
49
+ "${out_string} " )
50
+ string (REPLACE "_NONASCDICTNAME_"
51
+ "${lang} _stem" out_string
52
+ "${out_string} " )
53
+ string (REPLACE "_STOPWORDS_"
54
+ "${stopwords} " out_string
55
+ "${out_string} " )
56
+ file (APPEND "snowball_create.sql" ${out_string} )
57
+ endforeach ()
58
+
59
+
60
+ set (snowball_SRCS
61
+ dict_snowball.c
62
+ libstemmer/api.c
63
+ libstemmer/utilities.c
64
+ libstemmer/stem_ISO_8859_1_danish.c
65
+ libstemmer/stem_ISO_8859_1_dutch.c
66
+ libstemmer/stem_ISO_8859_1_english.c
67
+ libstemmer/stem_ISO_8859_1_finnish.c
68
+ libstemmer/stem_ISO_8859_1_french.c
69
+ libstemmer/stem_ISO_8859_1_german.c
70
+ libstemmer/stem_ISO_8859_1_hungarian.c
71
+ libstemmer/stem_ISO_8859_1_italian.c
72
+ libstemmer/stem_ISO_8859_1_norwegian.c
73
+ libstemmer/stem_ISO_8859_1_porter.c
74
+ libstemmer/stem_ISO_8859_1_portuguese.c
75
+ libstemmer/stem_ISO_8859_1_spanish.c
76
+ libstemmer/stem_ISO_8859_1_swedish.c
77
+ libstemmer/stem_ISO_8859_2_romanian.c
78
+ libstemmer/stem_KOI8_R_russian.c
79
+ libstemmer/stem_UTF_8_danish.c
80
+ libstemmer/stem_UTF_8_dutch.c
81
+ libstemmer/stem_UTF_8_english.c
82
+ libstemmer/stem_UTF_8_finnish.c
83
+ libstemmer/stem_UTF_8_french.c
84
+ libstemmer/stem_UTF_8_german.c
85
+ libstemmer/stem_UTF_8_hungarian.c
86
+ libstemmer/stem_UTF_8_italian.c
87
+ libstemmer/stem_UTF_8_norwegian.c
88
+ libstemmer/stem_UTF_8_porter.c
89
+ libstemmer/stem_UTF_8_portuguese.c
90
+ libstemmer/stem_UTF_8_romanian.c
91
+ libstemmer/stem_UTF_8_russian.c
92
+ libstemmer/stem_UTF_8_spanish.c
93
+ libstemmer/stem_UTF_8_swedish.c
94
+ libstemmer/stem_UTF_8_turkish.c
95
+ )
96
+
97
+ add_library (snowball SHARED ${snowball_SRCS} )
98
+ install (TARGETS snowball
99
+ RUNTIME DESTINATION ${PGBINDIR}
100
+ LIBRARY DESTINATION ${LIBDIR} )
101
+
102
+ install (FILES snowball_create.sql
103
+ DESTINATION ${PGSHAREDIR} )
104
+
105
+ install (FILES
106
+ stopwords/danish.stop
107
+ stopwords/dutch.stop
108
+ stopwords/english.stop
109
+ stopwords/finnish.stop
110
+ stopwords/french.stop
111
+ stopwords/german.stop
112
+ stopwords/hungarian.stop
113
+ stopwords/italian.stop
114
+ stopwords/norwegian.stop
115
+ stopwords/portuguese.stop
116
+ stopwords/romanian.stop
117
+ stopwords/russian.stop
118
+ stopwords/spanish.stop
119
+ stopwords/swedish.stop
120
+ stopwords/turkish.stop
121
+ DESTINATION ${PGSHAREDIR} /tsearch_data )
0 commit comments