<commit_before>#pragma once

#include "event_queue.hpp"
#include "types.hpp"
#include <unordered_map>

namespace krbn {
namespace manipulator {
namespace detail {
class basic final : public base {
public:
  basic(const nlohmann::json& json) : base() {
  }

  virtual ~basic(void) {
  }

  virtual manipulate(event_queue& event_queue) {
  }

private:

};
} // namespace detail
} // namespace manipulator
} // namespace krbn
<commit_msg>add from_, to_<commit_after>#pragma once

#include "manipulator/details/base.hpp"
#include "manipulator/details/types.hpp"
#include "manipulator/event_queue.hpp"
#include <json/json.hpp>
#include <unordered_map>

namespace krbn {
namespace manipulator {
namespace details {
class basic final : public base {
public:
  basic(const nlohmann::json& json) : base(),
                                      from_(json.find("from") != std::end(json) ? json["from"] : nlohmann::json()) {
    {
      const std::string key = "to";
      if (json.find(key) != std::end(json) && json[key].is_array()) {
        for (const auto& j : json[key]) {
          to_.emplace_back(j);
        }
      }
    }
  }

  virtual ~basic(void) {
  }

  virtual void manipulate(event_queue& event_queue) {
  }

  const event_definition& get_from(void) const {
    return from_;
  }

  const std::vector<event_definition>& get_to(void) const {
    return to_;
  }

private:
  event_definition from_;
  std::vector<event_definition> to_;
};
} // namespace details
} // namespace manipulator
} // namespace krbn

{'fraction_non_alphanumeric': 0.13663366336633664, 'fraction_numerical': 0.0, 'mean_word_length': 3.4069767441860463, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6198503', 'n_tokens_mistral': 507, 'n_tokens_neox': 497, 'n_words': 113}