Skip to content

Commit

Permalink
FSTALIGN-62: Changed how insert is posted in NLP output
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Vignanker committed Sep 11, 2023
1 parent c7f20c7 commit 9750acd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fstalign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,9 @@ void write_stitches_to_nlp(vector<Stitching>& stitches, ofstream &output_nlp_fil

ref_tk = original_nlp_token;
} else if (stitch.comment.find("ins") == 0) {
logger->info("an insertion was found for {} {}", stitch.hyptk, stitch.comment);
ref_tk = stitch.hyptk;
logger->debug("an insertion was found for {} {}", stitch.hyptk, stitch.comment);
ref_tk = "";
stitch.comment = "ins(" + stitch.hyptk + ")";
}

if (ref_tk == NOOP) {
Expand Down Expand Up @@ -690,7 +691,7 @@ void HandleWer(FstLoader& refLoader, FstLoader& hypLoader, SynonymEngine &engine

if (!output_nlp.empty()) {
ofstream nlp_ostream(output_nlp);
write_stitches_to_nlp(stitches, nlp_ostream, nlp_ref_loader->mJsonNorm, add_inserts_nlp);
write_stitches_to_nlp(stitches, nlp_ostream, nlp_ref_loader->mJsonNorm, add_inserts_nlp);
}
}

Expand Down

0 comments on commit 9750acd

Please sign in to comment.