PostgreSQL Source Code git master
stem_UTF_8_russian.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_envrussian_UTF_8_create_env (void)
 
void russian_UTF_8_close_env (struct SN_env *z)
 
int russian_UTF_8_stem (struct SN_env *z)
 

Function Documentation

◆ russian_UTF_8_close_env()

void russian_UTF_8_close_env ( struct SN_env z)

Definition at line 701 of file stem_UTF_8_russian.c.

701 {
702 SN_delete_env(z);
703}
void SN_delete_env(struct SN_env *z)
Definition: api.c:18

References SN_delete_env().

◆ russian_UTF_8_create_env()

struct SN_env * russian_UTF_8_create_env ( void  )

Definition at line 692 of file stem_UTF_8_russian.c.

692 {
693 struct SN_env * z = SN_new_env(sizeof(SN_local));
694 if (z) {
695 ((SN_local *)z)->i_p2 = 0;
696 ((SN_local *)z)->i_pV = 0;
697 }
698 return z;
699}
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
Definition: api.h:15

References SN_new_env().

◆ russian_UTF_8_stem()

int russian_UTF_8_stem ( struct SN_env z)

Definition at line 568 of file stem_UTF_8_russian.c.

568 {
569 {
570 int v_1 = z->c;
571 while (1) {
572 int v_2 = z->c;
573 while (1) {
574 int v_3 = z->c;
575 z->bra = z->c;
576 if (!(eq_s(z, 2, s_9))) goto lab2;
577 z->ket = z->c;
578 z->c = v_3;
579 break;
580 lab2:
581 z->c = v_3;
582 {
583 int ret = skip_utf8(z->p, z->c, z->l, 1);
584 if (ret < 0) goto lab1;
585 z->c = ret;
586 }
587 }
588 {
589 int ret = slice_from_s(z, 2, s_10);
590 if (ret < 0) return ret;
591 }
592 continue;
593 lab1:
594 z->c = v_2;
595 break;
596 }
597 z->c = v_1;
598 }
599 {
600 int ret = r_mark_regions(z);
601 if (ret < 0) return ret;
602 }
603 z->lb = z->c; z->c = z->l;
604 {
605 int v_4;
606 if (z->c < ((SN_local *)z)->i_pV) return 0;
607 v_4 = z->lb; z->lb = ((SN_local *)z)->i_pV;
608 {
609 int v_5 = z->l - z->c;
610 do {
611 int v_6 = z->l - z->c;
612 {
613 int ret = r_perfective_gerund(z);
614 if (ret == 0) goto lab4;
615 if (ret < 0) return ret;
616 }
617 break;
618 lab4:
619 z->c = z->l - v_6;
620 {
621 int v_7 = z->l - z->c;
622 {
623 int ret = r_reflexive(z);
624 if (ret == 0) { z->c = z->l - v_7; goto lab5; }
625 if (ret < 0) return ret;
626 }
627 lab5:
628 ;
629 }
630 do {
631 int v_8 = z->l - z->c;
632 {
633 int ret = r_adjectival(z);
634 if (ret == 0) goto lab6;
635 if (ret < 0) return ret;
636 }
637 break;
638 lab6:
639 z->c = z->l - v_8;
640 {
641 int ret = r_verb(z);
642 if (ret == 0) goto lab7;
643 if (ret < 0) return ret;
644 }
645 break;
646 lab7:
647 z->c = z->l - v_8;
648 {
649 int ret = r_noun(z);
650 if (ret == 0) goto lab3;
651 if (ret < 0) return ret;
652 }
653 } while (0);
654 } while (0);
655 lab3:
656 z->c = z->l - v_5;
657 }
658 {
659 int v_9 = z->l - z->c;
660 z->ket = z->c;
661 if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - v_9; goto lab8; }
662 z->bra = z->c;
663 {
664 int ret = slice_del(z);
665 if (ret < 0) return ret;
666 }
667 lab8:
668 ;
669 }
670 {
671 int v_10 = z->l - z->c;
672 {
673 int ret = r_derivational(z);
674 if (ret < 0) return ret;
675 }
676 z->c = z->l - v_10;
677 }
678 {
679 int v_11 = z->l - z->c;
680 {
681 int ret = r_tidy_up(z);
682 if (ret < 0) return ret;
683 }
684 z->c = z->l - v_11;
685 }
686 z->lb = v_4;
687 }
688 z->c = z->lb;
689 return 1;
690}
static int r_tidy_up(struct SN_env *z)
static int r_adjectival(struct SN_env *z)
static int r_verb(struct SN_env *z)
static int r_derivational(struct SN_env *z)
static int r_perfective_gerund(struct SN_env *z)
static const symbol s_10[]
static int r_mark_regions(struct SN_env *z)
static const symbol s_11[]
static int r_reflexive(struct SN_env *z)
static const symbol s_9[]
static int r_noun(struct SN_env *z)
int lb
Definition: api.h:17
symbol * p
Definition: api.h:16
int ket
Definition: api.h:17
int c
Definition: api.h:17
int bra
Definition: api.h:17
int l
Definition: api.h:17
SNOWBALL_ERR slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:432
int eq_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:231
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:236
SNOWBALL_ERR slice_del(struct SN_env *z)
Definition: utilities.c:443
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:43

References SN_env::bra, SN_env::c, eq_s(), eq_s_b(), SN_local::i_pV, SN_env::ket, SN_env::l, SN_env::lb, SN_env::p, r_adjectival(), r_derivational(), r_mark_regions(), r_noun(), r_perfective_gerund(), r_reflexive(), r_tidy_up(), r_verb(), s_10, s_11, s_9, skip_utf8(), slice_del(), and slice_from_s().