public override void ExtractFeature()
        {
            int count = 0;

            while (reader.HasNext())
            {
                if (++count % 10000 == 0)
                {
                    Console.Clear();
                    Console.WriteLine("{0} has processed {1}", Thread.CurrentThread.Name, count);
                }
                var e = reader.GetNextEvent();
                try
                {
                    var feature = extractor.ExtractFeature(e);
                    writer.WriteEvent(new Event(e.Label, feature));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    //Console.WriteLine(e.StackTrace);
                    Console.WriteLine(e);
                }
            }
            reader.Close();
            writer.Close();
        }
Example #2
0
        public override void ExtractFeature()
        {
            var count = 0;
            var dic   = new Dictionary <string, int>();

            foreach (var type in types)
            {
                dic[type] = dic.Count;
            }

            while (reader.HasNext())
            {
                if (++count % 1000 == 0)
                {
                    Console.WriteLine("{0} has processed {1}", Thread.CurrentThread.Name, count);
                }
                var e = reader.GetNextEvent();
                try
                {
                    var feature = extractor.ExtractFeature(e);
                    writer.WriteEvent(new Event(new Label(dic[e.Label.StringLabel].ToString()), feature));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.StackTrace);
                }
            }
            reader.Close();
            writer.Close();
        }