Skip to content

Commit 366c496

Browse files
committed
WIP: Use correct matrix dimensions for getTrainingAlignment
TODO: Update thot
1 parent 4c0f873 commit 366c496

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/SIL.Machine.Translation.Thot/ThotWordAlignmentModel.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ public void Save()
166166
public WordAlignmentMatrix GetTrainingAlignment(int n)
167167
{
168168
CheckDisposed();
169-
IntPtr nativeMatrix = Thot.AllocNativeMatrix(_sourceWords.Count, _targetWords.Count);
170169

171-
uint iLen = (uint)_sourceWords.Count;
172-
uint jLen = (uint)_targetWords.Count;
170+
uint iLen = 0;
171+
uint jLen = 0;
172+
Thot.swAlignModel_getTrainingAlignment(Handle, (uint)n, IntPtr.Zero, ref iLen, ref jLen);
173+
174+
IntPtr nativeMatrix = Thot.AllocNativeMatrix((int)iLen, (int)jLen);
173175
try
174176
{
175177
Thot.swAlignModel_getTrainingAlignment(Handle, (uint)n, nativeMatrix, ref iLen, ref jLen);

0 commit comments

Comments
 (0)