<commit_before>using System;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace IronAHK.Rusty
{
    partial class Core
    {
        internal abstract class WindowManager
        {
            #region Properties

            int delay = 100;

            public int Delay
            {
                get { return delay; }
                set { delay = value; }
            }

            #endregion

            #region Find

            #region Criteria

            public class SearchCriteria
            {
                public string Title { get; set; }
                public string Text { get; set; }
                public string ExcludeTitle { get; set; }
                public string ExcludeText { get; set; }

                public string ClassName { get; set; }
                public IntPtr ID { get; set; }
                public IntPtr PID { get; set; }
                public string Group { get; set; }

                public static SearchCriteria FromString(string mixed)
                {
                    var criteria = new SearchCriteria();
                    var opts = ParseOptions(mixed);
                    var i = 0;

                    while (i < opts.Length)
                    {
                        var current = opts[i++].ToLowerInvariant();
                        var next = ++i < opts.Length ? opts[i] : string.Empty;

                        switch (current)
                        {
                            case Keyword_ahk_class: criteria.ClassName = next; break;
                            case Keyword_ahk_group: criteria.Group = next; break;

                            case Keyword_ahk_id:
                                {
                                    long x;
                                    if (long.TryParse(next, out x)) criteria.ID = new IntPtr(x);
                                }
                                break;

                            case Keyword_ahk_pid:
                                {
                                    long x;
                                    if (long.TryParse(next, out x)) criteria.PID = new IntPtr(x);
                                }
                                break;

                            default:
                                criteria.Title = next;
                                i--;
                                break;
                        }
                    }

                    return criteria;
                }

                public static SearchCriteria FromString(string title, string text, string excludeTitle, string excludeText)
                {
                    var criteria = FromString(title);
                    criteria.Text = text;
                    criteria.ExcludeTitle = excludeTitle;
                    criteria.ExcludeText = excludeText;
                    return criteria;
                }<commit_msg>Replaced FromString methods in SearchCriteria class with HasExcludes and HasID getters.<commit_after>using System;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace IronAHK.Rusty
{
    partial class Core
    {
        internal abstract class WindowManager
        {
            #region Properties

            int delay = 100;

            public int Delay
            {
                get { return delay; }
                set { delay = value; }
            }

            #endregion

            #region Find

            #region Criteria

            public class SearchCriteria
            {
                public string Title { get; set; }
                public string Text { get; set; }
                public string ExcludeTitle { get; set; }
                public string ExcludeText { get; set; }

                public string ClassName { get; set; }
                public IntPtr ID { get; set; }
                public IntPtr PID { get; set; }
                public string Group { get; set; }

                public bool HasExcludes
                {
                    get { return !string.IsNullOrEmpty(ExcludeTitle) || !string.IsNullOrEmpty(ExcludeText); }
                }

                public bool HasID
                {
                    get { return ID != IntPtr.Zero || PID != IntPtr.Zero; }
                }
{'fraction_non_alphanumeric': 0.06301939058171745, 'fraction_numerical': 0.001615881809787627, 'mean_word_length': 0.9659709618874773, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3932448', 'n_tokens_mistral': 1008, 'n_tokens_neox': 912, 'n_words': 276}