PostgreSQL Source Code git master
stem_UTF_8_porter.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_envporter_UTF_8_create_env (void)
 
void porter_UTF_8_close_env (struct SN_env *z)
 
int porter_UTF_8_stem (struct SN_env *z)
 

Function Documentation

◆ porter_UTF_8_close_env()

void porter_UTF_8_close_env ( struct SN_env z)

Definition at line 777 of file stem_UTF_8_porter.c.

777 {
778 SN_delete_env(z);
779}
void SN_delete_env(struct SN_env *z)
Definition: api.c:18

References SN_delete_env().

◆ porter_UTF_8_create_env()

struct SN_env * porter_UTF_8_create_env ( void  )

Definition at line 768 of file stem_UTF_8_porter.c.

768 {
769 struct SN_env * z = SN_new_env(sizeof(SN_local));
770 if (z) {
771 ((SN_local *)z)->i_p2 = 0;
772 ((SN_local *)z)->i_p1 = 0;
773 }
774 return z;
775}
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
Definition: api.h:15

References SN_new_env().

◆ porter_UTF_8_stem()

int porter_UTF_8_stem ( struct SN_env z)

Definition at line 587 of file stem_UTF_8_porter.c.

587 {
588 int b_Y_found;
589 b_Y_found = 0;
590 {
591 int v_1 = z->c;
592 z->bra = z->c;
593 if (z->c == z->l || z->p[z->c] != 'y') goto lab0;
594 z->c++;
595 z->ket = z->c;
596 {
597 int ret = slice_from_s(z, 1, s_21);
598 if (ret < 0) return ret;
599 }
600 b_Y_found = 1;
601 lab0:
602 z->c = v_1;
603 }
604 {
605 int v_2 = z->c;
606 while (1) {
607 int v_3 = z->c;
608 while (1) {
609 int v_4 = z->c;
610 if (in_grouping_U(z, g_v, 97, 121, 0)) goto lab3;
611 z->bra = z->c;
612 if (z->c == z->l || z->p[z->c] != 'y') goto lab3;
613 z->c++;
614 z->ket = z->c;
615 z->c = v_4;
616 break;
617 lab3:
618 z->c = v_4;
619 {
620 int ret = skip_utf8(z->p, z->c, z->l, 1);
621 if (ret < 0) goto lab2;
622 z->c = ret;
623 }
624 }
625 {
626 int ret = slice_from_s(z, 1, s_22);
627 if (ret < 0) return ret;
628 }
629 b_Y_found = 1;
630 continue;
631 lab2:
632 z->c = v_3;
633 break;
634 }
635 z->c = v_2;
636 }
637 ((SN_local *)z)->i_p1 = z->l;
638 ((SN_local *)z)->i_p2 = z->l;
639 {
640 int v_5 = z->c;
641 {
642 int ret = out_grouping_U(z, g_v, 97, 121, 1);
643 if (ret < 0) goto lab4;
644 z->c += ret;
645 }
646 {
647 int ret = in_grouping_U(z, g_v, 97, 121, 1);
648 if (ret < 0) goto lab4;
649 z->c += ret;
650 }
651 ((SN_local *)z)->i_p1 = z->c;
652 {
653 int ret = out_grouping_U(z, g_v, 97, 121, 1);
654 if (ret < 0) goto lab4;
655 z->c += ret;
656 }
657 {
658 int ret = in_grouping_U(z, g_v, 97, 121, 1);
659 if (ret < 0) goto lab4;
660 z->c += ret;
661 }
662 ((SN_local *)z)->i_p2 = z->c;
663 lab4:
664 z->c = v_5;
665 }
666 z->lb = z->c; z->c = z->l;
667 {
668 int v_6 = z->l - z->c;
669 {
670 int ret = r_Step_1a(z);
671 if (ret < 0) return ret;
672 }
673 z->c = z->l - v_6;
674 }
675 {
676 int v_7 = z->l - z->c;
677 {
678 int ret = r_Step_1b(z);
679 if (ret < 0) return ret;
680 }
681 z->c = z->l - v_7;
682 }
683 {
684 int v_8 = z->l - z->c;
685 {
686 int ret = r_Step_1c(z);
687 if (ret < 0) return ret;
688 }
689 z->c = z->l - v_8;
690 }
691 {
692 int v_9 = z->l - z->c;
693 {
694 int ret = r_Step_2(z);
695 if (ret < 0) return ret;
696 }
697 z->c = z->l - v_9;
698 }
699 {
700 int v_10 = z->l - z->c;
701 {
702 int ret = r_Step_3(z);
703 if (ret < 0) return ret;
704 }
705 z->c = z->l - v_10;
706 }
707 {
708 int v_11 = z->l - z->c;
709 {
710 int ret = r_Step_4(z);
711 if (ret < 0) return ret;
712 }
713 z->c = z->l - v_11;
714 }
715 {
716 int v_12 = z->l - z->c;
717 {
718 int ret = r_Step_5a(z);
719 if (ret < 0) return ret;
720 }
721 z->c = z->l - v_12;
722 }
723 {
724 int v_13 = z->l - z->c;
725 {
726 int ret = r_Step_5b(z);
727 if (ret < 0) return ret;
728 }
729 z->c = z->l - v_13;
730 }
731 z->c = z->lb;
732 {
733 int v_14 = z->c;
734 if (!b_Y_found) goto lab5;
735 while (1) {
736 int v_15 = z->c;
737 while (1) {
738 int v_16 = z->c;
739 z->bra = z->c;
740 if (z->c == z->l || z->p[z->c] != 'Y') goto lab7;
741 z->c++;
742 z->ket = z->c;
743 z->c = v_16;
744 break;
745 lab7:
746 z->c = v_16;
747 {
748 int ret = skip_utf8(z->p, z->c, z->l, 1);
749 if (ret < 0) goto lab6;
750 z->c = ret;
751 }
752 }
753 {
754 int ret = slice_from_s(z, 1, s_23);
755 if (ret < 0) return ret;
756 }
757 continue;
758 lab6:
759 z->c = v_15;
760 break;
761 }
762 lab5:
763 z->c = v_14;
764 }
765 return 1;
766}
static int r_Step_5b(struct SN_env *z)
static int r_Step_3(struct SN_env *z)
static const symbol s_21[]
static const symbol s_23[]
static int r_Step_1c(struct SN_env *z)
static int r_Step_5a(struct SN_env *z)
static const symbol s_22[]
static int r_Step_1a(struct SN_env *z)
static int r_Step_4(struct SN_env *z)
static int r_Step_2(struct SN_env *z)
static int r_Step_1b(struct SN_env *z)
static const unsigned char g_v[]
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
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:157
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:133
SNOWBALL_ERR slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:432
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:43

References SN_env::bra, SN_env::c, g_v, in_grouping_U(), SN_env::ket, SN_env::l, SN_env::lb, out_grouping_U(), SN_env::p, r_Step_1a(), r_Step_1b(), r_Step_1c(), r_Step_2(), r_Step_3(), r_Step_4(), r_Step_5a(), r_Step_5b(), s_21, s_22, s_23, skip_utf8(), and slice_from_s().