Skip to content

Commit

Permalink
Add async suffix to preprocess method (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 authored Dec 3, 2024
1 parent 03e4716 commit 28f3c44
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ await client.BuildStartedAsync(
try
{
List<InsertPretranslationsRequest> pretranslationsRequests = [];
await _parallelCorpusPreprocessingService.Preprocess(
await _parallelCorpusPreprocessingService.PreprocessAsync(
request.Corpora.Select(Map).ToList(),
row => Task.CompletedTask,
(row, corpus) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ CancellationToken cancellationToken
int trainCount = 0;
int pretranslateCount = 0;
pretranslateWriter.WriteStartArray();
await _parallelCorpusPreprocessingService.Preprocess(
await _parallelCorpusPreprocessingService.PreprocessAsync(
corpora,
async row =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Nito.AsyncEx;

namespace SIL.ServiceToolkit.Utils;

public interface IParallelCorpusPreprocessingService
{
Task Preprocess(
Task PreprocessAsync(
IReadOnlyList<ParallelCorpus> corpora,
Func<Row, Task> train,
Func<Row, ParallelCorpus, Task> pretranslate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal int Seed
}
}

public async Task Preprocess(
public async Task PreprocessAsync(
IReadOnlyList<ParallelCorpus> corpora,
Func<Row, Task> train,
Func<Row, ParallelCorpus, Task> pretranslate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task TestParallelCorpusPreprocessor()
];
int trainCount = 0;
int pretranslateCount = 0;
await processor.Preprocess(
await processor.PreprocessAsync(
corpora,
row =>
{
Expand Down

0 comments on commit 28f3c44

Please sign in to comment.