Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit 9c26896

Browse files
author
Tomas Hagenau Andersen
committed
Update the list of health terms.
1 parent 81d4be6 commit 9c26896

File tree

5 files changed

+1094
-970
lines changed

5 files changed

+1094
-970
lines changed

include/health_rule.hpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
#include <string_view>
77
#include <wordlist_rule.hpp>
88

9-
using namespace OS2DSRules::WordListRule;
10-
119
namespace OS2DSRules {
1210

1311
namespace HealthRule {
1412

15-
class HealthRule final : public WordListRule {
13+
class HealthRule {
1614
public:
1715
HealthRule() noexcept;
16+
HealthRule(const HealthRule &) noexcept = default;
17+
HealthRule(HealthRule &&) noexcept = default;
1818
~HealthRule() noexcept = default;
19+
20+
[[nodiscard]] MatchResults find_matches(const std::string &) const noexcept;
21+
22+
private:
23+
OS2DSRules::WordListRule::WordListRule rule_;
1924
};
2025
} // namespace HealthRule
2126
} // namespace OS2DSRules

include/wordlist_rule.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace OS2DSRules {
1313

1414
namespace WordListRule {
1515

16+
using Words = std::unordered_set<std::string_view>;
17+
1618
class WordListRule {
1719
public:
1820
template <typename Iter>
@@ -22,6 +24,7 @@ class WordListRule {
2224
words_.insert(*iter);
2325
}
2426
}
27+
WordListRule(Words words) noexcept : words_(words) {}
2528
WordListRule() noexcept = default;
2629
WordListRule(const WordListRule &) noexcept = default;
2730
WordListRule(WordListRule &&) noexcept = default;
@@ -30,7 +33,7 @@ class WordListRule {
3033
[[nodiscard]] MatchResults find_matches(const std::string &) const noexcept;
3134

3235
protected:
33-
std::unordered_set<std::string_view> words_;
36+
Words words_;
3437

3538
private:
3639
[[nodiscard]] bool contains(const std::string_view) const noexcept;

0 commit comments

Comments
 (0)