<commit_before>using System;
using System.Linq;
using Premotion.Mansion.Core.Data.Specifications;

namespace Premotion.Mansion.Core.Data.Parser
{
	/// <summary>
	/// Parses the remaining parameters into property specifications.
	/// </summary>
	public class PropertyArgumentProcessor : QueryArgumentProcessor
	{
		#region Constructors
		/// <summary>
		/// Constructs this processor.
		/// </summary>
		public PropertyArgumentProcessor() : base(10)
		{
		}
		#endregion
		#region Overrides of QueryArgumentProcessor
		/// <summary>
		/// Processes the <paramref name="parameters"/> and turn them into <paramref name="query"/>.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="parameters">The parameters which to process.</param>
		/// <param name="query">The <see cref="Query"/> in which to set the parameters.</param>
		protected override void DoProcess(IMansionContext context, IPropertyBag parameters, Query query)
		{
			// loop through all the remaining properties
			foreach (var propertyName in parameters.Names)
			{
				// guard against empty properties
				string valueString;
				if (!parameters.TryGet(context, propertyName, out valueString) || string.IsNullOrWhiteSpace(valueString))
					continue;

				// parse the parameters, ignoring properties without values<commit_msg>* small fixes in the remaining property parser<commit_after>using System;
using System.Linq;
using Premotion.Mansion.Core.Data.Specifications;

namespace Premotion.Mansion.Core.Data.Parser
{
	/// <summary>
	/// Parses the remaining parameters into property specifications.
	/// </summary>
	public class PropertyArgumentProcessor : QueryArgumentProcessor
	{
		#region Constructors
		/// <summary>
		/// Constructs this processor.
		/// </summary>
		public PropertyArgumentProcessor() : base(10)
		{
		}
		#endregion
		#region Overrides of QueryArgumentProcessor
		/// <summary>
		/// Processes the <paramref name="parameters"/> and turn them into <paramref name="query"/>.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="parameters">The parameters which to process.</param>
		/// <param name="query">The <see cref="Query"/> in which to set the parameters.</param>
		protected override void DoProcess(IMansionContext context, IPropertyBag parameters, Query query)
		{
			// loop through all the remaining properties
			foreach (var propertyName in parameters.Names.ToArray())
			{
				// guard against empty properties
				string valueString;
				if (!parameters.TryGetAndRemove(context, propertyName, out valueString) || string.IsNullOrWhiteSpace(valueString))
					continue;

				// parse the parameters, ignoring properties without values
{'fraction_non_alphanumeric': 0.12099125364431487, 'fraction_numerical': 0.0014577259475218659, 'mean_word_length': 3.9638336347197107, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '3316273', 'n_tokens_mistral': 796, 'n_tokens_neox': 718, 'n_words': 222}