From 16fb76dea685b9e7c10fa4212859a07ba81a4baf Mon Sep 17 00:00:00 2001 From: John Lambert Date: Tue, 5 Nov 2024 16:04:10 -0500 Subject: [PATCH] a start --- .../IInteractiveTranslationModel.cs | 2 +- .../Translation/IWordAlignerEngine.cs | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/SIL.Machine/Translation/IWordAlignerEngine.cs diff --git a/src/SIL.Machine/Translation/IInteractiveTranslationModel.cs b/src/SIL.Machine/Translation/IInteractiveTranslationModel.cs index a9837c19..be448cdc 100644 --- a/src/SIL.Machine/Translation/IInteractiveTranslationModel.cs +++ b/src/SIL.Machine/Translation/IInteractiveTranslationModel.cs @@ -3,7 +3,7 @@ namespace SIL.Machine.Translation { - public interface IInteractiveTranslationModel : IInteractiveTranslationEngine, ITranslationModel + public interface IInteractiveTranslationModel : IInteractiveTranslationEngine, IWordAlignerEngine, ITranslationModel { Task SaveAsync(CancellationToken cancellationToken = default); void Save(); diff --git a/src/SIL.Machine/Translation/IWordAlignerEngine.cs b/src/SIL.Machine/Translation/IWordAlignerEngine.cs new file mode 100644 index 00000000..676f15e1 --- /dev/null +++ b/src/SIL.Machine/Translation/IWordAlignerEngine.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace SIL.Machine.Translation +{ + public interface IWordAlignerEngine : IDisposable + { + Task GetBestPhraseAlignmentAsync( + string sourceSegment, + string targetSegment, + CancellationToken cancellationToken = default + ); + + Task GetBestPhraseAlignmentAsync( + IReadOnlyList sourceSegment, + IReadOnlyList targetSegment, + CancellationToken cancellationToken = default + ); + + TranslationResult GetBestPhraseAlignment(string sourceSegment, string targetSegment); + + TranslationResult GetBestPhraseAlignment( + IReadOnlyList sourceSegment, + IReadOnlyList targetSegment + ); + } +}