Beispiel #1
0
 public MultiThreadingController(
     int workNum,
     MyDelegate.sendIntDelegate workCallback,
     int threadNum = 5
     )
 {
     threadNumber  = threadNum;
     threads       = new List <Thread>();
     workEvent     = workCallback;
     isRun         = false;
     nowWorkNumber = 0;
     allWorkNumber = workNum;
 }
Beispiel #2
0
 /// <summary>
 /// 使用分词器进行分词
 /// </summary>
 public void workCutString()
 {
     dc.sentences = null;
     dc.sentences = new List <Sentence>();
     print("开始分词。");
     try
     {
         MyDelegate.sendIntDelegate cutWordEvent = new MyDelegate.sendIntDelegate(workCutParagraph);
         MultiThreadingController   mtc          = new MultiThreadingController(dc.preResult.Count(), cutWordEvent);
         mtc.bStart();
         print("分词结束");
     }
     catch (Exception e)
     {
         print(e.Message);
     }
 }
Beispiel #3
0
 public MultiThreadingController(MyDelegate.sendIntDelegate workCallback)
     : this(0, workCallback, 1)
 {
 }