xapian-core  2.1.0
dutch_porter.h
Go to the documentation of this file.
1 /* Generated from dutch_porter.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  int i_p1;
15  bool b_e_found;
16  };
17 
18  private:
20 
21  void close_env() {
22  struct SN_env * z = &(zlocal.z);
23  lose_s(z->p);
24  }
25 
26  static int stem(struct SN_env * z);
27 
28  public:
30  struct SN_env * z = &(zlocal.z);
31  z->p = create_s();
32  }
33 
35  close_env();
36  }
37 
38  std::string operator()(const std::string& word) override {
39  struct SN_env* z = &(zlocal.z);
40  const symbol* s = reinterpret_cast<const symbol*>(word.data());
41  int s_size = word.size() > INT_MAX ? INT_MAX : word.size();
42  replace_s(z, 0, z->l, s_size, s);
43  z->c = 0;
45  return std::string(reinterpret_cast<const char*>(z->p), SIZE(z->p));
46  }
47 
48  bool use_proper_noun_heuristic() const override {
49  return true;
50  }
51 
52  std::string get_description() const override {
53  return "dutch_porter";
54  }
55 };
56 
57 }
unsigned char symbol
Definition: api.h:4
bool use_proper_noun_heuristic() const override
Should QueryParser suppress stemming for capitalised words?
Definition: dutch_porter.h:48
std::string operator()(const std::string &word) override
Stem the specified word.
Definition: dutch_porter.h:38
static int stem(struct SN_env *z)
std::string get_description() const override
Return a string describing this object.
Definition: dutch_porter.h:52
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