public void saveOutput(List <string> content, string path) { fileunit tLog = new fileunit(path, false); tLog.setContentLines(content); tLog.Save(); }
public fileunit toNewOutput(List <String> content, String name, String extension = "txt") { fileunit funit = getNewOutput(name, extension); funit.setContentLines(content); return(funit); }
/// <summary> /// Runs when a DLC is finished /// </summary> /// <param name="wRecord">The w record.</param> public void reportDomainFinished(modelSpiderSiteRecord wRecord) { folderNode fn = null; string fileprefix = wRecord.domainInfo.domainRootName.getCleanFilepath(); if (imbWEMManager.settings.directReportEngine.doDomainReport) { fn = folder[DRFolderEnum.sites].Add(wRecord.domainInfo.domainRootName.getCleanFilepath(), "Report on " + wRecord.domainInfo.domainName, "Records on domain " + wRecord.domainInfo.domainName + " crawled by " + name); if (REPORT_DOMAIN_TERMS) { if (wRecord.tRecord.instance.settings.doEnableDLC_TFIDF) { if (wRecord.context.targets.dlTargetPageTokens != null) { wRecord.context.targets.dlTargetPageTokens.GetDataSet(true).serializeDataSet("token_ptkn", fn, dataTableExportEnum.excel, notation); } } if (wRecord.context.targets.dlTargetLinkTokens != null) { wRecord.context.targets.dlTargetLinkTokens.GetDataSet(true).serializeDataSet("token_ltkn", fn, dataTableExportEnum.excel, notation); } } if (REPORT_DOMAIN_PAGES) { int c = 1; foreach (spiderTarget t in wRecord.context.targets.GetLoadedInOrderOfLoad()) { reportTarget(t, fn, c); c++; } } fileunit wLog = new fileunit(folder[DRFolderEnum.logs].pathFor(fileprefix + ".txt"), false); wLog.setContent(wRecord.logBuilder.ContentToString(true)); wLog.Save(); if (REPORT_ITERATION_URLS) { textByIteration url_loaded = urlsLoaded[wRecord]; //.GetOrAdd(wRecord, new textByIteration()); textByIteration url_detected = urlsDetected[wRecord]; //, new textByIteration()); fileunit url_ld_out = new fileunit(folder[DRFolderEnum.sites].pathFor(fileprefix + "_url_ld.txt"), false); fileunit url_dt_out = new fileunit(folder[DRFolderEnum.sites].pathFor(fileprefix + "_url_dt.txt"), false); fileunit url_srb_out = new fileunit(folder[DRFolderEnum.sites].pathFor(fileprefix + "_url_srb_ld.txt"), false); url_ld_out.setContentLines(url_loaded.GetAllUnique()); url_dt_out.setContentLines(url_detected.GetAllUnique()); url_srb_out.setContentLines(wRecord.relevantPages); url_ld_out.Save(); url_dt_out.Save(); url_srb_out.Save(); } //terms_out.Save(); //sentence_out.Save(); } if (REPORT_MODULES) { if (wRecord.tRecord.instance is spiderModularEvaluatorBase) { wRecord.frontierDLC.reportDomainOut(wRecord, fn, fileprefix); } } if (REPORT_TIMELINE) { wRecord.iterationTableRecord.GetDataTable(null, "iteration_performace_" + fileprefix).GetReportAndSave(folder[DRFolderEnum.it], notation, "iteration_performace_" + fileprefix); //, notation); } //if (REPORT_TIMELINE) //{ // DataTable dt = wRecord.GetTimeSeriesPerformance(); // timeSeries.Add(dt); // dt.GetReportAndSave(folder[DRFolderEnum.it], notation, "iteration_frontier_stats_" + fileprefix); //} wRecord.tRecord.lastDomainIterationTable.Add(wRecord.iterationTableRecord.GetLastEntryTouched()); wRecord.tRecord.instance.reportDomainFinished(this, wRecord); wRecord.Dispose(); }