PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
stem_ISO_8859_1_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_ISO_8859_1_create_env (void)
 
void porter_ISO_8859_1_close_env (struct SN_env *z)
 
int porter_ISO_8859_1_stem (struct SN_env *z)
 

Function Documentation

void porter_ISO_8859_1_close_env ( struct SN_env z)

Definition at line 748 of file stem_ISO_8859_1_porter.c.

References SN_close_env().

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

Definition at line 746 of file stem_ISO_8859_1_porter.c.

References SN_create_env().

746 { 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_ISO_8859_1_stem ( struct SN_env z)

Definition at line 581 of file stem_ISO_8859_1_porter.c.

References SN_env::B, SN_env::bra, SN_env::c, eq_s(), g_v, SN_env::I, in_grouping(), SN_env::ket, SN_env::l, SN_env::lb, out_grouping(), 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, and slice_from_s().

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