Exemplo n.º 1
0
        public async Task ProcessAsync(int documentId, DocumentParseResult documentResult, CancellationToken cancellationToken = default)
        {
            this.documentId = documentId;

            await this.dbContext.DoInTransactionAsync(async (token) =>
            {
                await RemovePreviousResultAsync(token);
                ProcessHierarchy(documentResult.RootHierarchyResult);
                await this.dbContext.SaveChangesAsync(token);
                return(true);
            }, cancellationToken);
        }
        public async Task ProcessAsync(int documentId, DocumentParseResult documentResult, CancellationToken cancellationToken = default)
        {
            var linearResult   = LinearParseResult.FromHierarchyParseResult(documentResult.RootHierarchyResult);
            var verseRelations = ProcessLinearResult(linearResult);

            await this.analyticsContext.DoInTransactionAsync(async (token) =>
            {
                this.analyticsContext.VerseRelationRepository.AddRange(verseRelations);
                await this.analyticsContext.SaveChangesAsync(token);
                return(true);
            }, cancellationToken);
        }
 public void Init(IDocumentId documentId)
 {
     DocumentId          = documentId;
     DocumentParseResult = new DocumentParseResult();
 }
Exemplo n.º 4
0
 private void CheckParseResults(DocumentParseResult docParseResult, params string[][] expectedResults)
 {
     base.CheckParseResults(docParseResult.GetAllParagraphParseResults().ToList(), expectedResults);
 }