예제 #1
0
        public static DataTable ToProfile(this TextIndexes indexes)
        {
            DataTable dt = new DataTable()
            {
                TableName = "Index Profile"
            };

            dt.Columns.Add("Count", typeof(int));
            dt.Columns.Add("Word", typeof(string));
            foreach (var item in indexes.OrderByDescending(i => i.Count).ThenBy(x => x.Value))
            {
                var r = dt.NewRow();
                r[0] = item.Count;
                r[1] = item.Value;
                dt.Rows.Add(r);
            }
            return(dt);
        }
예제 #2
0
        public static bool Load(this TextIndexes index, List <TextIndex> list)
        {
            index.AddRange(list);

            return(true);
        }