xapian-core  2.0.0
turkish.h
Go to the documentation of this file.
1 /* Generated from turkish.sbl by Snowball 3.0.0 - https://snowballstem.org/ */
2 
3 #include <xapian/stem.h>
4 
5 #define SNOWBALL_RUNTIME_THROW_EXCEPTIONS
7 
9 
11  public:
12  struct SN_local {
13  struct SN_env z;
15  };
16 
17  private:
19 
20  void close_env() {
21  struct SN_env * z = &(zlocal.z);
22  lose_s(z->p);
23  }
24 
25  static int stem(struct SN_env * z);
26 
27  public:
28  Turkish() {
29  struct SN_env * z = &(zlocal.z);
30  z->p = create_s();
31  }
32 
34  close_env();
35  }
36 
37  std::string operator()(const std::string& word) override {
38  struct SN_env* z = &(zlocal.z);
39  const symbol* s = reinterpret_cast<const symbol*>(word.data());
40  replace_s(z, 0, z->l, word.size(), s);
41  z->c = 0;
43  return std::string(reinterpret_cast<const char*>(z->p), SIZE(z->p));
44  }
45 
46  std::string get_description() const override {
47  return "turkish";
48  }
49 };
50 
51 }
unsigned char symbol
Definition: api.h:4
std::string get_description() const override
Return a string describing this object.
Definition: turkish.h:46
std::string operator()(const std::string &word) override
Stem the specified word.
Definition: turkish.h:37
static int stem(struct SN_env *z)
Definition: turkish.cc:1628
Class representing a stemming algorithm implementation.
Definition: stem.h:41
#define SIZE(p)
Definition: header.h:21
void lose_s(byte *p)
Definition: utilities.cc:38
byte * create_s(int n)
SNOWBALL_ERR replace_s(struct SN_env *z, int c_bra, int c_ket, int s_size, const symbol *s)
Definition: utilities.cc:396
stemming algorithms
Definition: api.h:15
symbol * p
Definition: api.h:16
int c
Definition: api.h:17
int l
Definition: api.h:17