mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-05 09:44:35 +00:00
Improved reading and writing large Office files without copying them into memory (#1243)
This commit is contained in:
1 parent
918572c158
commit
dbe609a9a7
37 files changed
+1161
-471
No files matched your search
@@ -199,7 +199,7 @@ public sealed class MarkdownSegmentFormatTests
|
||||
{
|
||||
var source = await this.WriteSourceAsync("Fish & Chips cost 5 \\* 3 \\| 2 © us.\n");
|
||||
|
||||
var keys = (await this.format.ReadAsync(source, CancellationToken.None)).Select(segment => segment.Key).ToList();
|
||||
var keys = (await this.format.ReadAsync(source, NullLogger.Instance, CancellationToken.None)).Select(segment => segment.Key).ToList();
|
||||
|
||||
Assert.That(keys, Is.EqualTo(new[] { "Fish & Chips cost 5 * 3 | 2 © us." }));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public sealed class MarkdownSegmentFormatTests
|
||||
{
|
||||
var source = await this.WriteSourceAsync("Press <1> to continue.\n\nPress <1 /> as well.\n\nOther words.\n");
|
||||
|
||||
var keys = (await this.format.ReadAsync(source, CancellationToken.None)).Select(segment => segment.Key).ToList();
|
||||
var keys = (await this.format.ReadAsync(source, NullLogger.Instance, CancellationToken.None)).Select(segment => segment.Key).ToList();
|
||||
|
||||
Assert.That(keys, Is.EqualTo(new[] { "Other words." }), "A model could not tell such words apart from tags, even when they come from two entities and the words between them.");
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public sealed class MarkdownSegmentFormatTests
|
||||
|
||||
private async Task<SegmentResults> ResultsAsync(string path, Func<string, string> transform)
|
||||
{
|
||||
var segments = await this.format.ReadAsync(path, CancellationToken.None);
|
||||
var segments = await this.format.ReadAsync(path, NullLogger.Instance, CancellationToken.None);
|
||||
return new SegmentResults(segments
|
||||
.Where(segment => segment.HasWords)
|
||||
.DistinctBy(segment => segment.Key)
|
||||
|
||||
Reference in new issue
Block a user