public KGDataImporter(string rootPath) { log = Log.Logger.ForContext <KGDataImporter>(); if (string.IsNullOrWhiteSpace(rootPath)) { throw new Exception("Rootpath of KG files are invalid."); } this.rootPath = PathUtility.CompletePath(rootPath); string[] files = Directory.GetFiles(rootPath, "*.json").Select(Path.GetFileName).ToArray(); foreach (string file in files) { if (file.Contains("Edge")) { this.edgeFileNames.Add(file); } else if (file.Contains("Vertex")) { this.vertexFileNames.Add(file); } } }
public NLUDataImporter(string rootPath) { if (string.IsNullOrWhiteSpace(rootPath)) { throw new Exception("Rootpath of NLU files are invalid."); } this.rootPath = PathUtility.CompletePath(rootPath); }
public VisuliaztionImporter(string rootPath) { if (string.IsNullOrWhiteSpace(rootPath)) { throw new Exception("Rootpath of VisulizationConfig files are invalid."); } this.rootPath = PathUtility.CompletePath(rootPath); string[] fileNamess = Directory.GetFiles(this.rootPath, "VisulizationConfig*.json").Select(Path.GetFileName).ToArray(); this.vConfig = new List <VisulizationConfig>(); foreach (string fileName in fileNamess) { string content = File.ReadAllText(this.rootPath + fileName); this.vConfig.AddRange(JsonConvert.DeserializeObject <List <VisulizationConfig> >(content)); } }