xapian-core
2.0.0
languages
algorithms
esperanto.h
Go to the documentation of this file.
1
/* Generated from esperanto.sbl by Snowball 3.0.0 - https://snowballstem.org/ */
2
3
#include <
xapian/stem.h
>
4
5
#define SNOWBALL_RUNTIME_THROW_EXCEPTIONS
6
#include "
languages/snowball_runtime.h
"
7
8
namespace
Xapian::Internal::Snowball
{
9
10
class
Esperanto
:
public
Xapian::StemImplementation
{
11
public
:
12
struct
SN_local
{
13
struct
SN_env
z
;
14
};
15
16
private
:
17
SN_local
zlocal
= {};
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
:
27
Esperanto
() {
28
struct
SN_env
* z = &(
zlocal
.
z
);
29
z->
p
=
create_s
();
30
}
31
32
~Esperanto
() {
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
replace_s
(z, 0, z->
l
, word.size(), s);
40
z->
c
= 0;
41
Xapian::Internal::Snowball::Esperanto::stem
(z);
42
return
std::string(
reinterpret_cast<
const
char
*
>
(z->
p
),
SIZE
(z->
p
));
43
}
44
45
std::string
get_description
()
const override
{
46
return
"esperanto"
;
47
}
48
};
49
50
}
symbol
unsigned char symbol
Definition:
api.h:4
Xapian::Internal::Snowball::Esperanto
Definition:
esperanto.h:10
Xapian::Internal::Snowball::Esperanto::get_description
std::string get_description() const override
Return a string describing this object.
Definition:
esperanto.h:45
Xapian::Internal::Snowball::Esperanto::~Esperanto
~Esperanto()
Definition:
esperanto.h:32
Xapian::Internal::Snowball::Esperanto::operator()
std::string operator()(const std::string &word) override
Stem the specified word.
Definition:
esperanto.h:36
Xapian::Internal::Snowball::Esperanto::zlocal
SN_local zlocal
Definition:
esperanto.h:17
Xapian::Internal::Snowball::Esperanto::stem
static int stem(struct SN_env *z)
Definition:
esperanto.cc:651
Xapian::Internal::Snowball::Esperanto::Esperanto
Esperanto()
Definition:
esperanto.h:27
Xapian::Internal::Snowball::Esperanto::close_env
void close_env()
Definition:
esperanto.h:19
Xapian::StemImplementation
Class representing a stemming algorithm implementation.
Definition:
stem.h:41
SIZE
#define SIZE(p)
Definition:
header.h:21
lose_s
void lose_s(byte *p)
Definition:
utilities.cc:38
create_s
byte * create_s(int n)
Xapian::Internal::Snowball
Definition:
arabic.h:8
snowball_runtime.h
replace_s
SNOWBALL_ERR replace_s(struct SN_env *z, int c_bra, int c_ket, int s_size, const symbol *s)
Definition:
utilities.cc:396
stem.h
stemming algorithms
SN_env
Definition:
api.h:15
SN_env::p
symbol * p
Definition:
api.h:16
SN_env::c
int c
Definition:
api.h:17
SN_env::l
int l
Definition:
api.h:17
Xapian::Internal::Snowball::Esperanto::SN_local
Definition:
esperanto.h:12
Xapian::Internal::Snowball::Esperanto::SN_local::z
struct SN_env z
Definition:
esperanto.h:13
Generated by
Doxygen 1.9.1