<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace scallion
{
	public class RegexPattern
	{
		private readonly SingleRegexPattern[] _regexPatterns;
		private readonly Regex _regex;
		public RegexPattern(string regex)
		{
			_regexPatterns = regex.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
				.Select(i => new SingleRegexPattern(i))
				.ToArray();
			_regex = new Regex(regex);
		}
		/// <summary>
		/// might return the same pattern multiple times. Call .Distinct on the results if you do not want this to be the case
		/// </summary>
		public IEnumerable<string> GenerateAllOnionPatternsForRegex()
		{
			return _regexPatterns.SelectMany(i => i.GenerateAllOnionPatternsForRegex());
		}
		public IEnumerable<string> GenerateOnionPatternsForGpu(int minCharacters)<commit_msg>1) Made change in RegexPattern<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace scallion
{
	public class RegexPattern
	{
		private readonly SingleRegexPattern[] _regexPatterns;
		private readonly Regex _regex;
		public RegexPattern(string regex)
		{
			_regexPatterns = regex.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
				.Select(i => new SingleRegexPattern(i))
				.ToArray();
			_regex = new Regex(regex);
		}
		public IEnumerable<string> GenerateAllOnionPatternsForRegex()
		{
			return _regexPatterns.SelectMany(i => i.GenerateAllOnionPatternsForRegex()).Distinct();
		}
		public IEnumerable<string> GenerateOnionPatternsForGpu(int minCharacters)
{'fraction_non_alphanumeric': 0.09791921664626684, 'fraction_numerical': 0.0006119951040391676, 'mean_word_length': 5.216730038022813, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '1172128', 'n_tokens_mistral': 536, 'n_tokens_neox': 487, 'n_words': 117}