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

722 { 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 720 of file stem_UTF_8_porter.c.

720 { 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 564 of file stem_UTF_8_porter.c.

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