-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
32 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System; | ||
using System.Collections.Generic; | ||
using SIL.Machine.Corpora; | ||
using SIL.ObjectModel; | ||
|
||
namespace SIL.Machine.Translation | ||
{ | ||
public interface IWordAlignmentModel : IWordAlignmentEngine | ||
public interface IWordAlignmentModel : IWordAligner, IDisposable | ||
{ | ||
IWordVocabulary SourceWords { get; } | ||
IWordVocabulary TargetWords { get; } | ||
IReadOnlySet<int> SpecialSymbolIndices { get; } | ||
|
||
ITrainer CreateTrainer(IParallelTextCorpus corpus); | ||
Task SaveAsync(CancellationToken cancellationToken = default); | ||
void Save(); | ||
|
||
IEnumerable<(string TargetWord, double Score)> GetTranslations(string sourceWord, double threshold = 0); | ||
IEnumerable<(int TargetWordIndex, double Score)> GetTranslations(int sourceWordIndex, double threshold = 0); | ||
|
||
double GetTranslationScore(string sourceWord, string targetWord); | ||
double GetTranslationScore(int sourceWordIndex, int targetWordIndex); | ||
|
||
IReadOnlyCollection<AlignedWordPair> GetBestAlignedWordPairs( | ||
IReadOnlyList<string> sourceSegment, | ||
IReadOnlyList<string> targetSegment | ||
); | ||
void ComputeAlignedWordPairScores( | ||
IReadOnlyList<string> sourceSegment, | ||
IReadOnlyList<string> targetSegment, | ||
IReadOnlyCollection<AlignedWordPair> wordPairs | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters