13
13
#include " mex.h"
14
14
#include " datatypes.h"
15
15
16
- // filter template
17
16
template <typename T, typename FN>
18
- std::vector<T> filterFileEntity (const extractor &input, FN ff) {
17
+ std::vector<T> filterFullEntity (const extractor &input, FN ff) {
19
18
std::vector<T> res;
20
19
21
20
switch (input.num <uint8_t >(2 )) {
@@ -35,14 +34,20 @@ std::vector<T> filterFileEntity(const extractor &input, FN ff) {
35
34
case switchFilter::Name:
36
35
res = ff (nix::util::NameFilter<T>(input.str (3 )));
37
36
break ;
37
+ case switchFilter::Metadata:
38
+ res = ff (nix::util::MetadataFilter<T>(input.str (3 )));
39
+ break ;
40
+ case switchFilter::Source:
41
+ res = ff (nix::util::SourceFilter<T>(input.str (3 )));
42
+ break ;
38
43
default : throw std::invalid_argument (" unknown or unsupported filter" );
39
44
}
40
45
41
46
return res;
42
47
}
43
48
44
49
template <typename T, typename FN>
45
- std::vector<T> filterEntity (const extractor &input, FN ff) {
50
+ std::vector<T> filterNameTypeEntity (const extractor &input, FN ff) {
46
51
std::vector<T> res;
47
52
48
53
switch (input.num <uint8_t >(2 )) {
@@ -62,20 +67,14 @@ std::vector<T> filterEntity(const extractor &input, FN ff) {
62
67
case switchFilter::Name:
63
68
res = ff (nix::util::NameFilter<T>(input.str (3 )));
64
69
break ;
65
- case switchFilter::Metadata:
66
- res = ff (nix::util::MetadataFilter<T>(input.str (3 )));
67
- break ;
68
- case switchFilter::Source:
69
- res = ff (nix::util::SourceFilter<T>(input.str (3 )));
70
- break ;
71
70
default : throw std::invalid_argument (" unknown or unsupported filter" );
72
71
}
73
72
74
73
return res;
75
74
}
76
75
77
76
template <typename T, typename FN>
78
- std::vector<T> filterFeature (const extractor &input, FN ff) {
77
+ std::vector<T> filterNamedEntity (const extractor &input, FN ff) {
79
78
std::vector<T> res;
80
79
81
80
switch (input.num <uint8_t >(2 )) {
@@ -89,14 +88,17 @@ std::vector<T> filterFeature(const extractor &input, FN ff) {
89
88
// this will crash matlab, if its not a vector of strings...
90
89
res = ff (nix::util::IdsFilter<T>(input.vec <std::string>(3 )));
91
90
break ;
91
+ case switchFilter::Name:
92
+ res = ff (nix::util::NameFilter<T>(input.str (3 )));
93
+ break ;
92
94
default : throw std::invalid_argument (" unknown or unsupported filter" );
93
95
}
94
96
95
97
return res;
96
98
}
97
99
98
100
template <typename T, typename FN>
99
- std::vector<T> filterProperty (const extractor &input, FN ff) {
101
+ std::vector<T> filterEntity (const extractor &input, FN ff) {
100
102
std::vector<T> res;
101
103
102
104
switch (input.num <uint8_t >(2 )) {
@@ -110,9 +112,6 @@ std::vector<T> filterProperty(const extractor &input, FN ff) {
110
112
// this will crash matlab, if its not a vector of strings...
111
113
res = ff (nix::util::IdsFilter<T>(input.vec <std::string>(3 )));
112
114
break ;
113
- case switchFilter::Name:
114
- res = ff (nix::util::NameFilter<T>(input.str (3 )));
115
- break ;
116
115
default : throw std::invalid_argument (" unknown or unsupported filter" );
117
116
}
118
117
0 commit comments