6 types derived from IngestionDocumentElement
Microsoft.Extensions.DataIngestion.Abstractions (6)
IngestionDocumentElement.cs (6)
71public sealed class IngestionDocumentSection : IngestionDocumentElement 102public sealed class IngestionDocumentParagraph : IngestionDocumentElement 117public sealed class IngestionDocumentHeader : IngestionDocumentElement 151public sealed class IngestionDocumentFooter : IngestionDocumentElement 166public sealed class IngestionDocumentTable : IngestionDocumentElement 200public sealed class IngestionDocumentImage : IngestionDocumentElement
43 references to IngestionDocumentElement
Microsoft.Extensions.DataIngestion (16)
Chunkers\ElementsChunker.cs (3)
35internal IEnumerable<IngestionChunk<string>> Process(IngestionDocument document, string context, List<IngestionDocumentElement> elements) 53IngestionDocumentElement element = elements[elementIndex]; 246IngestionDocumentElement other => other.GetMarkdown()
Chunkers\HeaderChunker.cs (3)
37List<IngestionDocumentElement> elements = []; 40foreach (IngestionDocumentElement element in document.EnumerateContent()) 68private IEnumerable<IngestionChunk<string>> SplitIntoChunks(IngestionDocument document, string?[] headers, List<IngestionDocumentElement> elements)
Chunkers\SectionChunker.cs (1)
49List<IngestionDocumentElement> elements = new(section.Elements.Count);
Chunkers\SemanticSimilarityChunker.cs (7)
52List<(IngestionDocumentElement, float)> distances = await CalculateDistancesAsync(document, cancellationToken).ConfigureAwait(false); 59private async Task<List<(IngestionDocumentElement element, float distance)>> CalculateDistancesAsync(IngestionDocument documents, CancellationToken cancellationToken) 61List<(IngestionDocumentElement element, float distance)> elementDistances = []; 64foreach (IngestionDocumentElement element in documents.EnumerateContent()) 96private IEnumerable<IngestionChunk<string>> MakeChunks(IngestionDocument document, List<(IngestionDocumentElement element, float distance)> elementDistances) 100List<IngestionDocumentElement> elementAccumulator = []; 118private float Percentile(List<(IngestionDocumentElement element, float distance)> elementDistances)
Processors\ImageAlternativeTextEnricher.cs (2)
42foreach (var element in document.EnumerateContent()) 60foreach (var cell in table.Cells)
Microsoft.Extensions.DataIngestion.Abstractions (8)
IngestionDocument.cs (3)
42public IEnumerable<IngestionDocumentElement> EnumerateContent() 44Stack<IngestionDocumentElement> elementsToProcess = new(); 53IngestionDocumentElement currentElement = elementsToProcess.Pop();
IngestionDocumentElement.cs (5)
25/// Initializes a new instance of the <see cref="IngestionDocumentElement"/> class. 92public IList<IngestionDocumentElement> Elements { get; } = []; 176public IngestionDocumentTable(string markdown, IngestionDocumentElement?[,] cells) 188/// <para>Null represents an empty cell (<see cref="IngestionDocumentElement.GetMarkdown()"/> can't return an empty string).</para> 191public IngestionDocumentElement?[,] Cells { get; }
Microsoft.Extensions.DataIngestion.Markdig (7)
MarkdownParser.cs (7)
77private static IngestionDocumentElement MapBlock(string documentMarkdown, bool previousWasBreak, Block block) 81IngestionDocumentElement element = block switch 93private static IngestionDocumentElement MapLeafBlockToElement(LeafBlock block, bool previousWasBreak, string elementMarkdown) 174IngestionDocumentElement element = MapLeafBlockToElement(leafBlock, previousWasBreak, childMarkdown); 243private static IngestionDocumentElement?[,] GetCells(Table table, string outputContent) 248var cells = new IngestionDocumentElement?[table.Count - firstRowIndex, table.ColumnDefinitions.Count - 1]; 257var content = tableCell.Count switch
Microsoft.Extensions.DataIngestion.MarkItDown (7)
src\Libraries\Microsoft.Extensions.DataIngestion.Markdig\MarkdownParser.cs (7)
77private static IngestionDocumentElement MapBlock(string documentMarkdown, bool previousWasBreak, Block block) 81IngestionDocumentElement element = block switch 93private static IngestionDocumentElement MapLeafBlockToElement(LeafBlock block, bool previousWasBreak, string elementMarkdown) 174IngestionDocumentElement element = MapLeafBlockToElement(leafBlock, previousWasBreak, childMarkdown); 243private static IngestionDocumentElement?[,] GetCells(Table table, string outputContent) 248var cells = new IngestionDocumentElement?[table.Count - firstRowIndex, table.ColumnDefinitions.Count - 1]; 257var content = tableCell.Count switch
Microsoft.Extensions.DataIngestion.Tests (5)
Chunkers\HeaderChunkerTests.cs (2)
247static IngestionDocumentElement?[,] CreateTableCells() 249var cells = new IngestionDocumentElement[6, 5]; // 6 rows (1 header + 5 data rows), 5 columns
IngestionDocumentTests.cs (2)
12private readonly IngestionDocumentElement?[,] _rows = 49IngestionDocumentElement[] flatElements = doc.EnumerateContent().ToArray();
Readers\DocumentReaderConformanceTests.cs (1)
212private static string? NormalizeCell(IngestionDocumentElement? ingestionDocumentElement)