Skip to content

Commit

Permalink
small updated needed for Serval
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Nov 20, 2024
1 parent 08a2719 commit 798c51c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/SIL.Machine/Corpora/AlignedWordPair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ public static IReadOnlyCollection<AlignedWordPair> Parse(string alignments, bool
return result;
}

public static bool TryParse(string alignments, out IReadOnlyCollection<AlignedWordPair> alignedWordPairs)
{
alignedWordPairs = null;
try
{
alignedWordPairs = Parse(alignments);
return true;
}
catch
{
return false;
}
}

public AlignedWordPair(int sourceIndex, int targetIndex)
{
SourceIndex = sourceIndex;
Expand Down

0 comments on commit 798c51c

Please sign in to comment.