xapian-core  2.1.0
armenian.h
Go to the documentation of this file.
1 /* Generated from armenian.sbl by Snowball 3.1.1 - 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;
14  };
15 
16  private:
18 
19  void close_env() {
20  struct SN_env * z = &(zlocal.z);
21  lose_s(z->p);
22  }
23 
24  static int stem(struct SN_env * z);
25 
26  public:
28  struct SN_env * z = &(zlocal.z);
29  z->p = create_s();
30  }
31 
33  close_env();
34  }
35 
36  std::string operator()(const std::string& word) override {
37  struct SN_env* z = &(zlocal.z);
38  const symbol* s = reinterpret_cast<const symbol*>(word.data());
39  int s_size = word.size() > INT_MAX ? INT_MAX : word.size();
40  replace_s(z, 0, z->l, s_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 "armenian";
48  }
49 };
50 
51 }
unsigned char symbol
Definition: api.h:4
std::string operator()(const std::string &word) override
Stem the specified word.
Definition: armenian.h:36
static int stem(struct SN_env *z)
Definition: armenian.cc:409
std::string get_description() const override
Return a string describing this object.
Definition: armenian.h:46
Class representing a stemming algorithm implementation.
Definition: stem.h:41
#define SIZE(p)
Definition: header.h:21
void lose_s(byte *p)
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)
stemming algorithms
Definition: api.h:12
symbol * p
Definition: api.h:13
int c
Definition: api.h:14
int l
Definition: api.h:14