PostgreSQL Source Code git master
stem_UTF_8_danish.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct SN_envdanish_UTF_8_create_env (void)
 
void danish_UTF_8_close_env (struct SN_env *z)
 
int danish_UTF_8_stem (struct SN_env *z)
 

Function Documentation

◆ danish_UTF_8_close_env()

void danish_UTF_8_close_env ( struct SN_env z)

Definition at line 354 of file stem_UTF_8_danish.c.

354 {
355 if (z) {
356 lose_s(((SN_local *)z)->s_ch);
357 }
358 SN_delete_env(z);
359}
void SN_delete_env(struct SN_env *z)
Definition: api.c:18
void lose_s(symbol *p)
Definition: utilities.c:31

References lose_s(), and SN_delete_env().

Referenced by danish_UTF_8_create_env().

◆ danish_UTF_8_create_env()

struct SN_env * danish_UTF_8_create_env ( void  )

Definition at line 340 of file stem_UTF_8_danish.c.

340 {
341 struct SN_env * z = SN_new_env(sizeof(SN_local));
342 if (z) {
343 ((SN_local *)z)->i_p1 = 0;
344 ((SN_local *)z)->s_ch = NULL;
345
346 if ((((SN_local *)z)->s_ch = create_s()) == NULL) {
348 return NULL;
349 }
350 }
351 return z;
352}
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
void danish_UTF_8_close_env(struct SN_env *z)
Definition: api.h:15
symbol * create_s(void)
Definition: utilities.c:20

References create_s(), danish_UTF_8_close_env(), and SN_new_env().

◆ danish_UTF_8_stem()

int danish_UTF_8_stem ( struct SN_env z)

Definition at line 294 of file stem_UTF_8_danish.c.

294 {
295 {
296 int v_1 = z->c;
297 {
298 int ret = r_mark_regions(z);
299 if (ret < 0) return ret;
300 }
301 z->c = v_1;
302 }
303 z->lb = z->c; z->c = z->l;
304 {
305 int v_2 = z->l - z->c;
306 {
307 int ret = r_main_suffix(z);
308 if (ret < 0) return ret;
309 }
310 z->c = z->l - v_2;
311 }
312 {
313 int v_3 = z->l - z->c;
314 {
315 int ret = r_consonant_pair(z);
316 if (ret < 0) return ret;
317 }
318 z->c = z->l - v_3;
319 }
320 {
321 int v_4 = z->l - z->c;
322 {
323 int ret = r_other_suffix(z);
324 if (ret < 0) return ret;
325 }
326 z->c = z->l - v_4;
327 }
328 {
329 int v_5 = z->l - z->c;
330 {
331 int ret = r_undouble(z);
332 if (ret < 0) return ret;
333 }
334 z->c = z->l - v_5;
335 }
336 z->c = z->lb;
337 return 1;
338}
static int r_other_suffix(struct SN_env *z)
static int r_consonant_pair(struct SN_env *z)
static int r_main_suffix(struct SN_env *z)
static int r_undouble(struct SN_env *z)
static int r_mark_regions(struct SN_env *z)
int lb
Definition: api.h:17
int c
Definition: api.h:17
int l
Definition: api.h:17

References SN_env::c, SN_env::l, SN_env::lb, r_consonant_pair(), r_main_suffix(), r_mark_regions(), r_other_suffix(), and r_undouble().