• R/O
  • SSH
  • HTTPS

chaki: Commit


Commit MetaInfo

Revisión647 (tree)
Tiempo2021-01-06 21:31:04
Autortomorita

Log Message

ProjectSelector comboboxにカレントコーパスのproject id listが表示されるよう修正

Cambiar Resumen

Diferencia incremental

--- trunk/ChaKi.NET/src/ChaKi.NET/Panels/ProjectSelector.cs (revision 646)
+++ trunk/ChaKi.NET/src/ChaKi.NET/Panels/ProjectSelector.cs (revision 647)
@@ -1,4 +1,5 @@
1-using System;
1+using ChaKi.Entity.Corpora;
2+using System;
23 using System.Collections.Generic;
34 using System.ComponentModel;
45 using System.Diagnostics;
@@ -12,6 +13,16 @@
1213 {
1314 public ProjectSelector()
1415 {
16+ ChaKiModel.OnCurrentChanged += CurrentCorpusChangedHandler;
1517 }
18+
19+ private void CurrentCorpusChangedHandler(Corpus cps, int senid)
20+ {
21+ this.Items.Clear();
22+ if (cps != null && cps.DocumentSet != null)
23+ {
24+ this.Items.AddRange((from p in cps.DocumentSet.Projects select p.ID.ToString()).ToArray());
25+ }
26+ }
1627 }
1728 }
--- trunk/ChaKi.NET/src/CreateCorpusSLA/Program.cs (revision 646)
+++ trunk/ChaKi.NET/src/CreateCorpusSLA/Program.cs (revision 647)
@@ -130,6 +130,7 @@
130130 static private void DoLUWJobs(CreateCorpus cc)
131131 {
132132 // 1. 通常のCabochaインポートを実行(Proj 0)
133+ Console.WriteLine("========================= SUW -> Proj0");
133134 cc.ReaderType = "Mecab|Cabocha|UniDic2";
134135 DoJobs(cc);
135136 // 2. LUWアノテーションから長単位Cabocha fileを一時的に作成
@@ -139,12 +140,21 @@
139140 LuwCabochaUtil.Convert(cc.InputPath, path);
140141 Console.WriteLine($"Written to: {path}");
141142 // 3. 長単位cabocha fileをProj 1にインポート
142- Console.WriteLine("=========================");
143+ Console.WriteLine("========================= LUW -> Proj1");
143144 Console.WriteLine("Importing temporary cabocha file of LUWs...");
144145 cc.ResetInternals();
145146 cc.InputPath = path;
146147 cc.ProjectId = 1;
147148 DoJobs(cc);
149+ // 4. 一時ファイルを削除
150+ try
151+ {
152+ File.Delete(path);
153+ }
154+ catch (Exception ex)
155+ {
156+ Console.WriteLine($"Cannot delete temp file: {ex.Message}");
157+ }
148158 }
149159
150160 static void PrintUsage()
--- trunk/ChaKi.NET/src/Service/Database/DBService.cs (revision 646)
+++ trunk/ChaKi.NET/src/Service/Database/DBService.cs (revision 647)
@@ -495,6 +495,14 @@
495495 }
496496 }
497497 }
498+
499+ // Project ID Listを取得
500+ var projects = session.CreateQuery("from Project").List<Project>();
501+ if (cps.DocumentSet == null)
502+ {
503+ cps.DocumentSet = new DocumentSet();
504+ }
505+ cps.DocumentSet.Projects = projects;
498506 }
499507 }
500508
Show on old repository browser