Exemplo n.º 1
0
        public override void DeployCustom()
        {
            primaryEntityOperation   = new OperationEntityEngine(setup.primaryRender, notes, notes);
            secondaryEntityOperation = new OperationEntityEngine(setup.secondaryRender, notes, notes);
            corpusOperation          = new OperationCorpusEngine(setup.secondaryModel.corpusForEvaluation, null, notes, notes);
            rankingOperation         = setup.secondaryModel.ranking.CloneViaXML(notes);
            rankingOperation.model.Deploy();
            rankingOperation.Describe(notes);

            componentsWithRequirements.Add(primaryEntityOperation);
            componentsWithRequirements.Add(secondaryEntityOperation);
            componentsWithRequirements.Add(corpusOperation);
            componentsWithRequirements.Add(rankingOperation);

            requirements = CheckRequirements();
        }
Exemplo n.º 2
0
        public override void DeployCustom()
        {
            entityOperation = new OperationEntityEngine(setup.renderForEvaluation, notes, notes);
            corpusOperation = new OperationCorpusEngine(setup.corpusForEvaluation, null, notes, notes);

            ranking = setup.ranking.CloneViaXML(notes);

            ranking.model.Deploy();

            ranking.Describe(notes);



            componentsWithRequirements.Add(entityOperation);
            componentsWithRequirements.Add(corpusOperation);
            componentsWithRequirements.Add(ranking);

            requirements = CheckRequirements();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Prepares the context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="log">The log.</param>
        /// <returns></returns>
        public static DocumentSelectResult PrepareContext(this OperationContext context, DocumentRankingMethod ranking, folderNode folder, ILogBuilder log)
        {
            DocumentSelectResult selectContext = new DocumentSelectResult();

            selectContext.stemmingContext = context.stemmContext;
            selectContext.spaceModel      = context.spaceModel;
            selectContext.folder          = folder;
            if (ranking != null)
            {
                selectContext.name  = ranking.model.GetSignature();
                selectContext.query = ranking.query;

                builderForText builder = new builderForText();
                ranking.Describe(builder);

                builder.AppendLine("Selected features [" + selectContext.selectedFeatures.description + "].");

                selectContext.description = builder.GetContent().Replace(Environment.NewLine, "");
            }

            selectContext.selectedFeatures = context.SelectedFeatures;



            foreach (KeyValuePair <string, WebSiteDocuments> pair in context.webSiteByDomain)
            {
                selectContext.domainNameToGraph.Add(pair.Key, pair.Value?.extensions?.graph);

                foreach (WebSiteDocument doc in pair.Value.documents)
                {
                    DocumentSelectResultEntry entry = new DocumentSelectResultEntry();
                    TextDocument text = null;

                    string err = "";


                    //if (context.textDocuments.ContainsKey(doc.AssignedID))
                    //{
                    //    text = context.textDocuments[doc.AssignedID];
                    //}
                    //else
                    //{
                    //    err += "Failed to find text document for [" + doc.AssignedID + "]";
                    //}

                    SpaceDocumentModel spaceDocument = context.spaceModel.documents.FirstOrDefault(x => x.name == doc.AssignedID);


                    if (spaceDocument == null)
                    {
                        err += "Failed to find space model document for [" + doc.AssignedID + "]";
                    }


                    string dn = pair.Value.domain;
                    entry.SetEntry(dn, doc, spaceDocument, text);

                    if (!entry.HasTextOrSpaceModel)
                    {
                        log.log(err);
                    }

                    selectContext.items.Add(entry);
                    //entry.SetEntry( context.context.webDocumentByAssignedID[pair.Key], webDocIDToDomain[aID], webDocumentRegistry[aID], spaceDocumentRegistry[aID], textDocumentRegistry[aID]);
                }
            }

            // PREPARATION OF MODEL
            if (ranking != null)
            {
                ranking.model.Prepare(selectContext, log);
            }
            return(selectContext);
        }