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(); }
private void CheckParseResults(DocumentParseResult docParseResult, params string[][] expectedResults) { base.CheckParseResults(docParseResult.GetAllParagraphParseResults().ToList(), expectedResults); }