PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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

void porter_UTF_8_close_env ( struct SN_env z)

Definition at line 754 of file stem_UTF_8_porter.c.

References SN_close_env().

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

Definition at line 752 of file stem_UTF_8_porter.c.

References SN_create_env().

752 { return SN_create_env(0, 2, 1); }
struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
Definition: api.c:3
int porter_UTF_8_stem ( struct SN_env z)

Definition at line 583 of file stem_UTF_8_porter.c.

References SN_env::B, SN_env::bra, SN_env::c, eq_s(), 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_29, s_30, s_31, s_32, s_33, s_34, skip_utf8(), and slice_from_s().

583  {
584  z->B[0] = 0; /* unset Y_found, line 115 */
585  { int c1 = z->c; /* do, line 116 */
586  z->bra = z->c; /* [, line 116 */
587  if (!(eq_s(z, 1, s_29))) goto lab0;
588  z->ket = z->c; /* ], line 116 */
589  { int ret = slice_from_s(z, 1, s_30); /* <-, line 116 */
590  if (ret < 0) return ret;
591  }
592  z->B[0] = 1; /* set Y_found, line 116 */
593  lab0:
594  z->c = c1;
595  }
596  { int c2 = z->c; /* do, line 117 */
597  while(1) { /* repeat, line 117 */
598  int c3 = z->c;
599  while(1) { /* goto, line 117 */
600  int c4 = z->c;
601  if (in_grouping_U(z, g_v, 97, 121, 0)) goto lab3;
602  z->bra = z->c; /* [, line 117 */
603  if (!(eq_s(z, 1, s_31))) goto lab3;
604  z->ket = z->c; /* ], line 117 */
605  z->c = c4;
606  break;
607  lab3:
608  z->c = c4;
609  { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
610  if (ret < 0) goto lab2;
611  z->c = ret; /* goto, line 117 */
612  }
613  }
614  { int ret = slice_from_s(z, 1, s_32); /* <-, line 117 */
615  if (ret < 0) return ret;
616  }
617  z->B[0] = 1; /* set Y_found, line 117 */
618  continue;
619  lab2:
620  z->c = c3;
621  break;
622  }
623  z->c = c2;
624  }
625  z->I[0] = z->l;
626  z->I[1] = z->l;
627  { int c5 = z->c; /* do, line 121 */
628  { /* gopast */ /* grouping v, line 122 */
629  int ret = out_grouping_U(z, g_v, 97, 121, 1);
630  if (ret < 0) goto lab4;
631  z->c += ret;
632  }
633  { /* gopast */ /* non v, line 122 */
634  int ret = in_grouping_U(z, g_v, 97, 121, 1);
635  if (ret < 0) goto lab4;
636  z->c += ret;
637  }
638  z->I[0] = z->c; /* setmark p1, line 122 */
639  { /* gopast */ /* grouping v, line 123 */
640  int ret = out_grouping_U(z, g_v, 97, 121, 1);
641  if (ret < 0) goto lab4;
642  z->c += ret;
643  }
644  { /* gopast */ /* non v, line 123 */
645  int ret = in_grouping_U(z, g_v, 97, 121, 1);
646  if (ret < 0) goto lab4;
647  z->c += ret;
648  }
649  z->I[1] = z->c; /* setmark p2, line 123 */
650  lab4:
651  z->c = c5;
652  }
653  z->lb = z->c; z->c = z->l; /* backwards, line 126 */
654 
655  { int m6 = z->l - z->c; (void)m6; /* do, line 127 */
656  { int ret = r_Step_1a(z);
657  if (ret == 0) goto lab5; /* call Step_1a, line 127 */
658  if (ret < 0) return ret;
659  }
660  lab5:
661  z->c = z->l - m6;
662  }
663  { int m7 = z->l - z->c; (void)m7; /* do, line 128 */
664  { int ret = r_Step_1b(z);
665  if (ret == 0) goto lab6; /* call Step_1b, line 128 */
666  if (ret < 0) return ret;
667  }
668  lab6:
669  z->c = z->l - m7;
670  }
671  { int m8 = z->l - z->c; (void)m8; /* do, line 129 */
672  { int ret = r_Step_1c(z);
673  if (ret == 0) goto lab7; /* call Step_1c, line 129 */
674  if (ret < 0) return ret;
675  }
676  lab7:
677  z->c = z->l - m8;
678  }
679  { int m9 = z->l - z->c; (void)m9; /* do, line 130 */
680  { int ret = r_Step_2(z);
681  if (ret == 0) goto lab8; /* call Step_2, line 130 */
682  if (ret < 0) return ret;
683  }
684  lab8:
685  z->c = z->l - m9;
686  }
687  { int m10 = z->l - z->c; (void)m10; /* do, line 131 */
688  { int ret = r_Step_3(z);
689  if (ret == 0) goto lab9; /* call Step_3, line 131 */
690  if (ret < 0) return ret;
691  }
692  lab9:
693  z->c = z->l - m10;
694  }
695  { int m11 = z->l - z->c; (void)m11; /* do, line 132 */
696  { int ret = r_Step_4(z);
697  if (ret == 0) goto lab10; /* call Step_4, line 132 */
698  if (ret < 0) return ret;
699  }
700  lab10:
701  z->c = z->l - m11;
702  }
703  { int m12 = z->l - z->c; (void)m12; /* do, line 133 */
704  { int ret = r_Step_5a(z);
705  if (ret == 0) goto lab11; /* call Step_5a, line 133 */
706  if (ret < 0) return ret;
707  }
708  lab11:
709  z->c = z->l - m12;
710  }
711  { int m13 = z->l - z->c; (void)m13; /* do, line 134 */
712  { int ret = r_Step_5b(z);
713  if (ret == 0) goto lab12; /* call Step_5b, line 134 */
714  if (ret < 0) return ret;
715  }
716  lab12:
717  z->c = z->l - m13;
718  }
719  z->c = z->lb;
720  { int c14 = z->c; /* do, line 137 */
721  if (!(z->B[0])) goto lab13; /* Boolean test Y_found, line 137 */
722  while(1) { /* repeat, line 137 */
723  int c15 = z->c;
724  while(1) { /* goto, line 137 */
725  int c16 = z->c;
726  z->bra = z->c; /* [, line 137 */
727  if (!(eq_s(z, 1, s_33))) goto lab15;
728  z->ket = z->c; /* ], line 137 */
729  z->c = c16;
730  break;
731  lab15:
732  z->c = c16;
733  { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
734  if (ret < 0) goto lab14;
735  z->c = ret; /* goto, line 137 */
736  }
737  }
738  { int ret = slice_from_s(z, 1, s_34); /* <-, line 137 */
739  if (ret < 0) return ret;
740  }
741  continue;
742  lab14:
743  z->c = c15;
744  break;
745  }
746  lab13:
747  z->c = c14;
748  }
749  return 1;
750 }
static const symbol s_29[]
static int r_Step_1a(struct SN_env *z)
symbol * p
Definition: api.h:15
int skip_utf8(const symbol *p, int c, int lb, int l, int n)
Definition: utilities.c:30
int * I
Definition: api.h:18
int ket
Definition: api.h:16
int bra
Definition: api.h:16
static int r_Step_3(struct SN_env *z)
int c
Definition: api.h:16
int eq_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:189
static const symbol s_32[]
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:392
static const symbol s_33[]
static int r_Step_1c(struct SN_env *z)
int lb
Definition: api.h:16
static const symbol s_34[]
static int r_Step_2(struct SN_env *z)
static const symbol s_30[]
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:91
static int r_Step_5b(struct SN_env *z)
static int r_Step_5a(struct SN_env *z)
static const symbol s_31[]
static int r_Step_1b(struct SN_env *z)
static const unsigned char g_v[]
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:115
unsigned char * B
Definition: api.h:19
static int r_Step_4(struct SN_env *z)
int l
Definition: api.h:16