<commit_before>/// \file You-QueryEngine/internal/filter.h
/// Defines the base class for filters.
/// \author A0112054Y
#include "stdafx.h"
#include "filter.h"

namespace You {
namespace QueryEngine {

using FFilter = Filter::FFilter;
// Common filters
std::unique_ptr<Filter> Filter::anyTask() {
	auto f = [] (const Task&) -> bool {
		return true;
	};
	return std::unique_ptr<Filter>(new Filter(f));
}

Filter& Filter::operator&&(const Filter& filter) {
	ffilter = AND(ffilter, filter.ffilter);
	return *this;
}

Filter& Filter::operator||(const Filter& filter) {
	ffilter = OR(ffilter, filter.ffilter);
	return *this;
}

Filter& Filter::operator!() {
	ffilter = NOT(ffilter);
	return *this;
}

FFilter Filter::AND(const FFilter& f, const FFilter& g) {
	return [=] (FFilter::argument_type x) {
		return f(x) && g(x);
	};<commit_msg>Forgot to implement operator FFilter()<commit_after>/// \file You-QueryEngine/internal/filter.h
/// Defines the base class for filters.
/// \author A0112054Y
#include "stdafx.h"
#include "filter.h"

namespace You {
namespace QueryEngine {

using FFilter = Filter::FFilter;
// Common filters
std::unique_ptr<Filter> Filter::anyTask() {
	auto f = [] (const Task&) -> bool {
		return true;
	};
	return std::unique_ptr<Filter>(new Filter(f));
}

Filter& Filter::operator&&(const Filter& filter) {
	ffilter = AND(ffilter, filter.ffilter);
	return *this;
}

Filter& Filter::operator||(const Filter& filter) {
	ffilter = OR(ffilter, filter.ffilter);
	return *this;
}

Filter& Filter::operator!() {
	ffilter = NOT(ffilter);
	return *this;
}

Filter::operator FFilter() const {
	return ffilter;
}

FFilter Filter::AND(const FFilter& f, const FFilter& g) {
	return [=] (FFilter::argument_type x) {
		return f(x) && g(x);
	};
{'fraction_non_alphanumeric': 0.16647597254004576, 'fraction_numerical': 0.008009153318077803, 'mean_word_length': 4.83, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2102036', 'n_tokens_mistral': 649, 'n_tokens_neox': 635, 'n_words': 155}