public ClusteringTreeModel(List <string> dataSet, List <string> parsedRegions, List <string> fileTextes, List <string> files) { int leafIndex = 0; nodeCollection = new ClusterNodeCollection(); leafCollection = new ClusterLeafCollection(); var hash = new HashSet <string>(); foreach (string item in dataSet) { if (hash.Contains(item)) { leafIndex++; continue; } hash.Add(item); var leaf = new ClusterLeaf { Id = leafIndex, FileName = files[leafIndex], FileText = fileTextes[leafIndex], Region = parsedRegions[leafIndex], Value = dataSet[leafIndex] }; leafCollection.Add(leaf); leafIndex++; } }
public void BuildSingletonCluster(ClusterLeafCollection clusterLeafCollection) { int clusterId = 0; foreach (ClusterLeaf leaf in clusterLeafCollection) { ClusterNode cluster = new ClusterNode { Id = clusterId, TotalLeafsCount = 1, }; cluster.Add(leaf); nodes.Add(cluster); clusterId++; } }