xapian-core
2.0.0
languages
algorithms
finnish.h
Go to the documentation of this file.
1
/* Generated from finnish.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
Finnish
:
public
Xapian::StemImplementation
{
11
public
:
12
struct
SN_local
{
13
struct
SN_env
z
;
14
int
i_p2
;
15
int
i_p1
;
16
bool
b_ending_removed
;
17
symbol
*
s_x
;
18
};
19
20
private
:
21
SN_local
zlocal
= {};
22
23
void
close_env
() {
24
struct
SN_env
* z = &(
zlocal
.
z
);
25
lose_s
(((
SN_local
*)z)->s_x);
26
lose_s
(z->
p
);
27
}
28
29
static
int
stem
(
struct
SN_env
* z);
30
31
public
:
32
Finnish
() {
33
struct
SN_env
* z = &(
zlocal
.
z
);
34
z->
p
=
create_s
();
35
try
{
36
((
SN_local
*)z)->s_x =
create_s
();
37
}
catch
(...) {
38
close_env
();
39
throw
;
40
}
41
}
42
43
~Finnish
() {
44
close_env
();
45
}
46
47
std::string
operator()
(
const
std::string& word)
override
{
48
struct
SN_env
* z = &(
zlocal
.
z
);
49
const
symbol
* s =
reinterpret_cast<
const
symbol
*
>
(word.data());
50
replace_s
(z, 0, z->
l
, word.size(), s);
51
z->
c
= 0;
52
Xapian::Internal::Snowball::Finnish::stem
(z);
53
return
std::string(
reinterpret_cast<
const
char
*
>
(z->
p
),
SIZE
(z->
p
));
54
}
55
56
std::string
get_description
()
const override
{
57
return
"finnish"
;
58
}
59
};
60
61
}
symbol
unsigned char symbol
Definition:
api.h:4
Xapian::Internal::Snowball::Finnish
Definition:
finnish.h:10
Xapian::Internal::Snowball::Finnish::stem
static int stem(struct SN_env *z)
Definition:
finnish.cc:604
Xapian::Internal::Snowball::Finnish::get_description
std::string get_description() const override
Return a string describing this object.
Definition:
finnish.h:56
Xapian::Internal::Snowball::Finnish::zlocal
SN_local zlocal
Definition:
finnish.h:21
Xapian::Internal::Snowball::Finnish::Finnish
Finnish()
Definition:
finnish.h:32
Xapian::Internal::Snowball::Finnish::operator()
std::string operator()(const std::string &word) override
Stem the specified word.
Definition:
finnish.h:47
Xapian::Internal::Snowball::Finnish::~Finnish
~Finnish()
Definition:
finnish.h:43
Xapian::Internal::Snowball::Finnish::close_env
void close_env()
Definition:
finnish.h:23
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::Finnish::SN_local
Definition:
finnish.h:12
Xapian::Internal::Snowball::Finnish::SN_local::s_x
symbol * s_x
Definition:
finnish.h:17
Xapian::Internal::Snowball::Finnish::SN_local::z
struct SN_env z
Definition:
finnish.h:13
Xapian::Internal::Snowball::Finnish::SN_local::i_p1
int i_p1
Definition:
finnish.h:15
Xapian::Internal::Snowball::Finnish::SN_local::b_ending_removed
bool b_ending_removed
Definition:
finnish.h:16
Xapian::Internal::Snowball::Finnish::SN_local::i_p2
int i_p2
Definition:
finnish.h:14
Generated by
Doxygen 1.9.1