public override void eventDLCInitiated(directReporterBase __spider, crawlerDomainTask __task, modelSpiderSiteRecord __wRecord) { if (imbWEMManager.settings.directReportEngine.doDomainReport) { string dlc_config = imbWEMManager.index.experimentEntry.sessionCrawlerFolder["sites"].pathFor("dlc_config_" + __wRecord.domainInfo.domainRootName.getFilename(".txt")); builderForMarkdown builder = new builderForMarkdown(); spiderTools.Describe(__task.evaluator, builder); builder.ToString().saveStringToFile(dlc_config); } }
/// <summary> /// Gets the user manual for table saved. /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="path">The path.</param> /// <param name="directInfo">The direct information.</param> /// <param name="skipUnDescribed">if set to <c>true</c> [skip un described].</param> /// <param name="showValue">if set to <c>true</c> [show value].</param> public static void GetUserManualForTableSaved(this DataTable dataObject, String path, String directInfo = "", Boolean skipUnDescribed = true, Boolean showValue = true) { builderForMarkdown mdb = new builderForMarkdown(); dataObject.GetUserManualForTable(mdb, directInfo, skipUnDescribed); FileInfo fi = path.getWritableFile(); String output = mdb.ToString(false); output.saveStringToFile(fi.FullName); }
/// <summary> /// Prepares all rules for new case /// </summary> public override void prepareAll() { base.prepareAll(); pageScoreRules.prepare(); linkActiveRules.prepare(); linkPassiveRules.prepare(); pageClassificationRules.prepare(); pageContentScoreRules.prepare(); builderForMarkdown bl = new builderForMarkdown(); this.Describe(bl); FullDescription = bl.ToString(); }
/// <summary> /// Gets the caller information report. /// </summary> /// <param name="output">The output.</param> /// <returns></returns> public static String getCallerInfoReport(this callerInfo output) { builderForMarkdown sb = new builderForMarkdown(); sb.Append("Caller info report:", appendType.heading_3, true); sb.nextTabLevel(); // sb.AppendLine("Caller method: " + labelFormat); sb.AppendPair("Call in code: ", output.sufix); sb.AppendPair("Method name: ", output.className); sb.AppendPair("Source file: ", output.Filepath); sb.Append("Source call line: ", appendType.bold, true); sb.Append(output.sourceCodeLine, appendType.source, true); sb.Append("Source call line segment: ", appendType.regular, true); sb.Append(output.sourceCodeInvokePart, appendType.source, true); sb.Append("Caller method local variables:", appendType.heading_4); sb.nextTabLevel(); output.localVariables.ForEach( x => sb.Append( String.Format("{0}:{1} {2}", x.LocalIndex, x.LocalType.Name, x.toStringSafe()), appendType.quotation) ); sb.prevTabLevel(); sb.AppendPair("Caller source line properties:", output.sourceCodeParameterCalls.toCsvInLine()); sb.prevTabLevel(); sb.prevTabLevel(); return(sb.ToString()); }
public void reportIteration(dataUnitSpiderIteration dataUnit, modelSpiderSiteRecord wRecord, ISpiderEvaluatorBase evaluator) { iterationPerformanceRecord ip_record = new iterationPerformanceRecord(wRecord); wRecord.iterationTableRecord.Add(ip_record); folderNode fn; //siteRecords[wRecord].Add(dataUnit.iteration.ToString("D3"), wRecord.domainInfo.domainRootName + dataUnit.iteration.ToString("D3"), "Iteration " + dataUnit.iteration + " on domain: " + wRecord.domainInfo.domainName); if (imbWEMManager.settings.directReportEngine.doIterationReport) { if (imbWEMManager.settings.directReportEngine.doDomainReport) { fn = getIterationFolder(dataUnit.iteration, wRecord); if (REPORT_WRECORD_LOG) { wRecord.logBuilder.getLastLine().saveStringToFile(fn.pathFor("wrecord.txt")); } string fileprefix = wRecord.domainInfo.domainRootName.getCleanFilepath(); textByIteration url_loaded = urlsLoaded[wRecord]; //.GetOrAdd(wRecord, new textByIteration()); textByIteration url_detected = urlsDetected[wRecord]; //, new textByIteration()); //textByIteration terms_ext = termsExtracted[wRecord]; //textByIteration sentence_ext = sentencesExtracted[wRecord]; if (REPORT_MODULES) { if (imbWEMManager.settings.directReportEngine.DR_ReportModules_XMLIteration) { if (wRecord.tRecord.instance is spiderModularEvaluatorBase) { wRecord.frontierDLC.reportIterationOut(wRecord, fn); } } } string its = dataUnit.iteration.ToString("D3"); //DataTable dt = wRecord.context.targets.GetDataTable(); //dt.SetTitle(fileprefix + "_targets"); //dt.serializeDataTable(aceCommonTypes.enums.dataTableExportEnum.csv, "", fn, notation); //sentence_ext[dataUnit.iteration].AddRangeUnique(wRecord.context.targets.blocks.GetHashList()); //if (REPORT_ITERATION_TERMS) //{ // fileunit blocks = new fileunit(fn.pathFor(its + "_blc.txt"), false); // blocks.setContentLines(sentence_ext[dataUnit.iteration]); // blocks.Save(); //} if (REPORT_TIMELINE) { objectSerialization.saveObjectToXML(ip_record, fn.pathFor("performance.xml")); } if (REPORT_ITERATION_URLS) { if (wRecord.iteration > 0) { builderForMarkdown now_loaded = new builderForMarkdown(); //fileunit now_loaded = new fileunit(fn.pathFor(its + "_loadedNow.txt"), false); List <spiderTarget> targets_loaded = wRecord.context.targets.GetLoadedInIteration(wRecord.iteration - 1); int tc = 0; foreach (spiderTarget t in targets_loaded) { reportTarget(t, fn, tc); now_loaded.AppendLine(t.url); now_loaded.AppendHorizontalLine(); now_loaded.Append(t.marks.GetActiveResults()); now_loaded.AppendHorizontalLine(); now_loaded.Append(t.marks.GetPassiveResults()); now_loaded.AppendHorizontalLine(); var dt = t.marks.getHistory(t.url, wRecord.tRecord.instance.name); dt.Save(fn, imbWEMManager.authorNotation, its + "_loadedNow"); now_loaded.AppendTable(dt, false); tc++; } now_loaded.ToString().saveStringToFile(fn.pathFor(its + "_loadedNow.txt")); spiderTaskResult loadResults = wRecord.spiderTaskResults[wRecord.iteration - 1]; loadResults.getDataTable().GetReportAndSave(fn, notation, "loadResults", true); // .serializeDataTable(aceCommonTypes.enums.dataTableExportEnum.excel, "loadResults", fn, notation); } fileunit detected = new fileunit(fn.pathFor(its + "_dt.txt"), false); fileunit loaded = new fileunit(fn.pathFor(its + "_ld.txt"), false); fileunit relp = new fileunit(fn.pathFor(its + "_srb_ld.txt"), false); relp.Append(wRecord.relevantPages, true); foreach (spiderTarget t in wRecord.context.targets) { if (t.page != null) { //t.contentBlocks.ForEach(x => sentence_ext[dataUnit.iteration].AddUnique(x.textHash)); loaded.Append(t.url); url_loaded[dataUnit.iteration].Add(t.url); } else { detected.Append(t.url); url_detected[dataUnit.iteration].Add(t.url); } } string lineFormat = "{0,5} {1,30} [s:{1,6}]" + Environment.NewLine; fileunit active = new fileunit(fn.pathFor(its + "_act.txt"), false); int c = 1; foreach (var lnk in wRecord.web.webActiveLinks) { active.Append(string.Format(lineFormat, c, lnk.url, lnk.marks.score)); active.Append(lnk.marks.GetLayerAssociation()); c++; } detected.Save(); loaded.Save(); active.Save(); } } } wRecord.tRecord.instance.reportIteration(this, wRecord); }