MorphInterpretation.cpp
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* File: MorphInterpretation.cpp
* Author: mlenart
*
* Created on November 14, 2013, 11:47 AM
*/
#include <string>
#include "MorphInterpretation.hpp"
#include "EncodedInterpretation.hpp"
using namespace std;
static string convertLemma(
const string& orth,
const EncodedLemma& lemma) {
string res(orth);
res.erase(
res.end() - lemma.suffixToCut,
res.end());
res.append(lemma.suffixToAdd);
return res;
}
MorphInterpretation::MorphInterpretation(
int startNode,
int endNode,
const std::string& orth,
const EncodedInterpretation& encodedInterp,
const Tagset& tagset)
: startNode(startNode),
endNode(endNode),
orth(orth),
lemma(convertLemma(orth, encodedInterp.lemma)),
tagnum(encodedInterp.tag),
namenum(encodedInterp.nameClassifier),
tag(tagset.getTag(encodedInterp.tag)),
name(tagset.getName(encodedInterp.nameClassifier)) {
}
MorphInterpretation::~MorphInterpretation() {
}
int MorphInterpretation::getStartNode() const {
return this->startNode;
}
int MorphInterpretation::getEndNode() const {
return this->endNode;
}
const std::string& MorphInterpretation::getOrth() const {
return this->orth;
}
const std::string& MorphInterpretation::getLemma() const {
return this->lemma;
}
int MorphInterpretation::getTagnum() const {
return this->tagnum;
}
int MorphInterpretation::getNamenum() const {
return this->namenum;
}
const std::string& MorphInterpretation::getTag() const {
return this->tag;
}
const std::string& MorphInterpretation::getName() const {
return this->name;
}