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