PostgreSQL Source Code git master
stem_UTF_8_polish.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_envpolish_UTF_8_create_env (void)
 
void polish_UTF_8_close_env (struct SN_env *z)
 
int polish_UTF_8_stem (struct SN_env *z)
 

Function Documentation

◆ polish_UTF_8_close_env()

void polish_UTF_8_close_env ( struct SN_env z)

Definition at line 520 of file stem_UTF_8_polish.c.

520 {
521 SN_delete_env(z);
522}
void SN_delete_env(struct SN_env *z)
Definition: api.c:18

References SN_delete_env().

◆ polish_UTF_8_create_env()

struct SN_env * polish_UTF_8_create_env ( void  )

Definition at line 512 of file stem_UTF_8_polish.c.

512 {
513 struct SN_env * z = SN_new_env(sizeof(SN_local));
514 if (z) {
515 ((SN_local *)z)->i_p1 = 0;
516 }
517 return z;
518}
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
Definition: api.h:15

References SN_new_env().

◆ polish_UTF_8_stem()

int polish_UTF_8_stem ( struct SN_env z)

Definition at line 476 of file stem_UTF_8_polish.c.

476 {
477 {
478 int v_1 = z->c;
479 {
480 int ret = r_mark_regions(z);
481 if (ret < 0) return ret;
482 }
483 z->c = v_1;
484 }
485 do {
486 int v_2 = z->c;
487 {
488 int ret = skip_utf8(z->p, z->c, z->l, 2);
489 if (ret < 0) goto lab0;
490 z->c = ret;
491 }
492 z->lb = z->c; z->c = z->l;
493 {
494 int ret = r_remove_endings(z);
495 if (ret == 0) goto lab0;
496 if (ret < 0) return ret;
497 }
498 z->c = z->lb;
499 break;
500 lab0:
501 z->c = v_2;
502 z->lb = z->c; z->c = z->l;
503 {
504 int ret = r_normalize_consonant(z);
505 if (ret <= 0) return ret;
506 }
507 z->c = z->lb;
508 } while (0);
509 return 1;
510}
static int r_normalize_consonant(struct SN_env *z)
static int r_mark_regions(struct SN_env *z)
static int r_remove_endings(struct SN_env *z)
int lb
Definition: api.h:17
symbol * p
Definition: api.h:16
int c
Definition: api.h:17
int l
Definition: api.h:17
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:43

References SN_env::c, SN_env::l, SN_env::lb, SN_env::p, r_mark_regions(), r_normalize_consonant(), r_remove_endings(), and skip_utf8().