<commit_before>#include <catch.hpp>
#include "../wold.hpp"

namespace wold {

  TEST_CASE("foo", "[]") {
    REQUIRE(foo() == 42);
  }

} // namespace wold<commit_msg>Add basic x3 parsing demo test<commit_after>#include <catch.hpp>
#include "../wold.hpp"

#include <boost/spirit/home/x3.hpp>
#include <iostream>

namespace wold {

  TEST_CASE("foo", "[]") {
    REQUIRE(foo() == 42);
  }

  TEST_CASE("parsing", "[]") {
    using boost::spirit::x3::double_;
    using boost::spirit::x3::ascii::space;

    auto text = std::string("  val 12.3 ");
    double result;
    auto success = boost::spirit::x3::phrase_parse(
        text.begin(), text.end(),
        "val" >> double_,
        space,
        result);

    REQUIRE(success);
    std::cout << result << "\n";
  }

} // namespace wold
{'fraction_non_alphanumeric': 0.19771863117870722, 'fraction_numerical': 0.015209125475285171, 'mean_word_length': 3.136125654450262, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7529348', 'n_tokens_mistral': 299, 'n_tokens_neox': 278, 'n_words': 55}