Encog.Parse.Tags.Read.ReadXML.ReadPropertyBlock C# (CSharp) Method

ReadPropertyBlock() public method

Read all property data until an end tag, which corrisponds to the current tag, is found. The properties found will be returned in a map.
public ReadPropertyBlock ( ) : String>.IDictionary
return String>.IDictionary
        public IDictionary<String, String> ReadPropertyBlock()
        {
            IDictionary<String, String> result = new Dictionary<String, String>();

            String endingBlock = LastTag.Name;

            while (ReadToTag())
            {
                if (LastTag.Name.Equals(endingBlock)
                    && (LastTag.TagType == Tag.Type.End))
                {
                    break;
                }
                String name = LastTag.Name;
                String value = ReadTextToTag().Trim();
                result[name] = value;
            }

            return result;
        }

Usage Example

        /// <summary>
        /// Handle reading an item tag.
        /// </summary>
        /// <param name="xmlIn">The XML reader.</param>
        private void HandleItem(ReadXML xmlIn)
        {
            IDictionary<String, String> properties = xmlIn.ReadPropertyBlock();
            INeuralDataPair pair = null;
            INeuralData input = new BasicNeuralData(NumberList
                   .FromList(CSVFormat.EG_FORMAT, properties
                           [BasicNeuralDataSetPersistor.TAG_INPUT]));

            if (properties.ContainsKey(BasicNeuralDataSetPersistor.TAG_IDEAL))
            {
                // supervised
                INeuralData ideal = new BasicNeuralData(NumberList
                       .FromList(CSVFormat.EG_FORMAT, properties
                               [BasicNeuralDataSetPersistor.TAG_IDEAL]));
                pair = new BasicNeuralDataPair(input, ideal);
            }
            else
            {
                // unsupervised
                pair = new BasicNeuralDataPair(input);
            }

            this.currentDataSet.Add(pair);
        }
All Usage Examples Of Encog.Parse.Tags.Read.ReadXML::ReadPropertyBlock