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 723 of file stem_UTF_8_porter.c.

723{ SN_close_env(z, 0); }
void SN_close_env(struct SN_env *z, int S_size)
Definition: api.c:34

References SN_close_env().

◆ porter_UTF_8_create_env()

struct SN_env * porter_UTF_8_create_env ( void  )

Definition at line 721 of file stem_UTF_8_porter.c.

721{ return SN_create_env(0, 3); }
struct SN_env * SN_create_env(int S_size, int I_size)
Definition: api.c:3

References SN_create_env().

◆ porter_UTF_8_stem()

int porter_UTF_8_stem ( struct SN_env z)

Definition at line 561 of file stem_UTF_8_porter.c.

561 {
562 z->I[2] = 0;
563 { int c1 = z->c;
564 z->bra = z->c;
565 if (z->c == z->l || z->p[z->c] != 'y') goto lab0;
566 z->c++;
567 z->ket = z->c;
568 { int ret = slice_from_s(z, 1, s_21);
569 if (ret < 0) return ret;
570 }
571 z->I[2] = 1;
572 lab0:
573 z->c = c1;
574 }
575 { int c2 = z->c;
576 while(1) {
577 int c3 = z->c;
578 while(1) {
579 int c4 = z->c;
580 if (in_grouping_U(z, g_v, 97, 121, 0)) goto lab3;
581 z->bra = z->c;
582 if (z->c == z->l || z->p[z->c] != 'y') goto lab3;
583 z->c++;
584 z->ket = z->c;
585 z->c = c4;
586 break;
587 lab3:
588 z->c = c4;
589 { int ret = skip_utf8(z->p, z->c, z->l, 1);
590 if (ret < 0) goto lab2;
591 z->c = ret;
592 }
593 }
594 { int ret = slice_from_s(z, 1, s_22);
595 if (ret < 0) return ret;
596 }
597 z->I[2] = 1;
598 continue;
599 lab2:
600 z->c = c3;
601 break;
602 }
603 z->c = c2;
604 }
605 z->I[1] = z->l;
606 z->I[0] = z->l;
607 { int c5 = z->c;
608
609 {
610 int ret = out_grouping_U(z, g_v, 97, 121, 1);
611 if (ret < 0) goto lab4;
612 z->c += ret;
613 }
614
615 {
616 int ret = in_grouping_U(z, g_v, 97, 121, 1);
617 if (ret < 0) goto lab4;
618 z->c += ret;
619 }
620 z->I[1] = z->c;
621
622 {
623 int ret = out_grouping_U(z, g_v, 97, 121, 1);
624 if (ret < 0) goto lab4;
625 z->c += ret;
626 }
627
628 {
629 int ret = in_grouping_U(z, g_v, 97, 121, 1);
630 if (ret < 0) goto lab4;
631 z->c += ret;
632 }
633 z->I[0] = z->c;
634 lab4:
635 z->c = c5;
636 }
637 z->lb = z->c; z->c = z->l;
638
639 { int m6 = z->l - z->c; (void)m6;
640 { int ret = r_Step_1a(z);
641 if (ret < 0) return ret;
642 }
643 z->c = z->l - m6;
644 }
645 { int m7 = z->l - z->c; (void)m7;
646 { int ret = r_Step_1b(z);
647 if (ret < 0) return ret;
648 }
649 z->c = z->l - m7;
650 }
651 { int m8 = z->l - z->c; (void)m8;
652 { int ret = r_Step_1c(z);
653 if (ret < 0) return ret;
654 }
655 z->c = z->l - m8;
656 }
657 { int m9 = z->l - z->c; (void)m9;
658 { int ret = r_Step_2(z);
659 if (ret < 0) return ret;
660 }
661 z->c = z->l - m9;
662 }
663 { int m10 = z->l - z->c; (void)m10;
664 { int ret = r_Step_3(z);
665 if (ret < 0) return ret;
666 }
667 z->c = z->l - m10;
668 }
669 { int m11 = z->l - z->c; (void)m11;
670 { int ret = r_Step_4(z);
671 if (ret < 0) return ret;
672 }
673 z->c = z->l - m11;
674 }
675 { int m12 = z->l - z->c; (void)m12;
676 { int ret = r_Step_5a(z);
677 if (ret < 0) return ret;
678 }
679 z->c = z->l - m12;
680 }
681 { int m13 = z->l - z->c; (void)m13;
682 { int ret = r_Step_5b(z);
683 if (ret < 0) return ret;
684 }
685 z->c = z->l - m13;
686 }
687 z->c = z->lb;
688 { int c14 = z->c;
689 if (!(z->I[2])) goto lab5;
690 while(1) {
691 int c15 = z->c;
692 while(1) {
693 int c16 = z->c;
694 z->bra = z->c;
695 if (z->c == z->l || z->p[z->c] != 'Y') goto lab7;
696 z->c++;
697 z->ket = z->c;
698 z->c = c16;
699 break;
700 lab7:
701 z->c = c16;
702 { int ret = skip_utf8(z->p, z->c, z->l, 1);
703 if (ret < 0) goto lab6;
704 z->c = ret;
705 }
706 }
707 { int ret = slice_from_s(z, 1, s_23);
708 if (ret < 0) return ret;
709 }
710 continue;
711 lab6:
712 z->c = c15;
713 break;
714 }
715 lab5:
716 z->c = c14;
717 }
718 return 1;
719}
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:16
symbol * p
Definition: api.h:15
int * I
Definition: api.h:18
int ket
Definition: api.h:16
int c
Definition: api.h:16
int bra
Definition: api.h:16
int l
Definition: api.h:16
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:141
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:117
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:27
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:422

References SN_env::bra, SN_env::c, g_v, SN_env::I, 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().