Example #1
0
File: Arff.cs Project: jfreax/BAIMP
        void AddValue(ResultStats rs, IFeature feature)
        {
            string completeFeatureName = Regex.Replace(Regex.Replace(rs.fibername, @"#\d*", ""), @".*projectfiles.*_", "") + "_" + rs.uncompleteFeatureName + "_" + feature.Key();

            int attributeIndex = attributes.IndexOf(completeFeatureName);
            if (attributeIndex == -1) {
                attributes.Add(completeFeatureName);
                attributeIndex = attributes.Count - 1;
            }

            if (!values.ContainsKey(rs.fibername)) {
                values[rs.fibername] = new DataHolder(rs.classname, rs.distinctSourceString);
            }

            values[rs.fibername].attributes[attributeIndex] = feature.Value();
            classes.Add(rs.classname);
        }