Encog.App.Analyst.Analyze.AnalyzedField.Analyze1 C# (CSharp) Method

Analyze1() public method

Perform a pass one analysis of this field.
public Analyze1 ( String v ) : void
v String
return void
        public void Analyze1(String v)
        {
            bool accountedFor = false;
            string str = v.Trim();

            if (str.Trim().Length == 0 || str.Equals("?"))
            {
                Complete = false;
                return;
            }

            _instances++;

            if (Real)
            {
                try
                {
                    double d = CSVFormat.EgFormat.Parse(str);
                    Max = Math.Max(d, Max);
                    Min = Math.Min(d, Min);
                    _total += d;
                    accountedFor = true;
                }
                catch (FormatException)
                {
                    Real = false;
                    if (!Integer)
                    {
                        Max = 0;
                        Min = 0;
                        StandardDeviation = 0;
                    }
                }
            }

            if (Integer)
            {
                try
                {
                    int i = Int32.Parse(str);
                    Max = Math.Max(i, Max);
                    Min = Math.Min(i, Min);
                    if (!accountedFor)
                    {
                        _total += i;
                    }
                }
                catch (FormatException)
                {
                    Integer = false;
                    if (!Real)
                    {
                        Max = 0;
                        Min = 0;
                        StandardDeviation = 0;
                    }
                }
            }

            if (Class)
            {
                AnalystClassItem item;

                // is this a new class?
                if (!_classMap.ContainsKey(str))
                {
                    item = new AnalystClassItem(str, str, 1);
                    _classMap[str] = item;

                    // do we have too many different classes?
                    int max = _script.Properties.GetPropertyInt(
                        ScriptProperties.SetupConfigMaxClassCount);
                    if (_classMap.Count > max)
                    {
                        Class = false;
                    }
                }
                else
                {
                    item = _classMap[str];
                    item.IncreaseCount();
                }
            }
        }