Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release/
*.nupkg
.vs/
.vscode/
.idea/

build*/
artifacts/
Expand Down
11 changes: 11 additions & 0 deletions src/shared_library/thot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,17 @@ extern "C"
{
auto alignmentModel = static_cast<AlignmentModel*>(swAlignModelHandle);

if (matrix == nullptr)
{
// Retrieve the dimensions of the training alignment matrix for sentence pair n
Count c;
std::vector<std::string> srcSentence, trgSentence;
alignmentModel->getSentencePair(n, srcSentence, trgSentence, c);
*iLen = (unsigned int)srcSentence.size();
*jLen = (unsigned int)trgSentence.size();
return SMALL_LG_NUM;
}

WordAlignmentMatrix waMatrix;
LgProb prob = alignmentModel->getTrainingAlignment(n, waMatrix);
// A filtered/out-of-range pair yields an empty matrix, so clamp to its actual
Expand Down
Loading