<commit_before>/*
 * File:  PPPatMatch.cpp
 * Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)
 */

#include "sedna.h"

#include "PPPatMatch.h"
#include "e_string.h"
#include "strings.h"


void PPPatMatch::cf_choice(void)
{
switch (pmt)
	{
	case pm_match: comp_fun = &PPPatMatch::matches;break;
	case pm_replace: comp_fun = &PPPatMatch::replace;break;
	case pm_tokenize: 
		{
			comp_fun = &PPPatMatch::tokenize;break;
			tknzr=NULL;
		}
		break;
	}
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_),pmt(_pmt_),ch_cnt(2)
{
	cf_choice();
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,PPOpIn _seq3_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_), seq3(_seq3_),pmt(_pmt_),ch_cnt(3)
{
	cf_choice();
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,PPOpIn _seq3_,PPOpIn _seq4_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_), seq3(_seq3_), seq4(_seq4_),pmt(_pmt_),ch_cnt(4)
{
	cf_choice();
}

PPPatMatch::~PPPatMatch()
{
	delete seq1.op;
	seq1.op = NULL;
	delete seq2.op;
	seq2.op = NULL;
	if (ch_cnt>2)
	{
		delete seq3.op;
		seq3.op = NULL;
		if (ch_cnt>3)
		{
			delete seq4.op;
			seq4.op = NULL;
		}
	}
}<commit_msg>re fix<commit_after>/*
 * File:  PPPatMatch.cpp
 * Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)
 */

#include "sedna.h"

#include "PPPatMatch.h"
#include "e_string.h"
#include "strings.h"


void PPPatMatch::cf_choice(void)
{
switch (pmt)
	{
	case pm_match: comp_fun = &PPPatMatch::matches;break;
	case pm_replace: comp_fun = &PPPatMatch::replace;break;
	case pm_tokenize: 
		{
			comp_fun = &PPPatMatch::tokenize;break;
			tknzr=NULL;
		}
		break;
	}
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_),pmt(_pmt_),ch_cnt(2)
{
	cf_choice();
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,PPOpIn _seq3_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_), seq3(_seq3_),pmt(_pmt_),ch_cnt(3),tknzr(NULL)
{
	cf_choice();
}
PPPatMatch::PPPatMatch(variable_context *_cxt_,
						 PPOpIn _seq1_, PPOpIn _seq2_,PPOpIn _seq3_,PPOpIn _seq4_,patmatch_type _pmt_):
			PPIterator(_cxt_), seq1(_seq1_) , seq2(_seq2_), seq3(_seq3_), seq4(_seq4_),pmt(_pmt_),ch_cnt(4),tknzr(NULL)
{
	cf_choice();
}

PPPatMatch::~PPPatMatch()
{
	delete seq1.op;
	seq1.op = NULL;
	delete seq2.op;
	seq2.op = NULL;
	if (ch_cnt>2)
	{
		delete seq3.op;
		seq3.op = NULL;
		if (ch_cnt>3)
		{
			delete seq4.op;
			seq4.op = NULL;
		}
	}
}
{'fraction_non_alphanumeric': 0.14392059553349876, 'fraction_numerical': 0.03119461183977313, 'mean_word_length': 5.02991452991453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7235119', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1242, 'n_words': 211}