mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
K translations in pipeline
This commit is contained in:
@@ -357,7 +357,7 @@ def translation_pipeline(props):
|
|||||||
else:
|
else:
|
||||||
bestTranslationIdx = 0;
|
bestTranslationIdx = 0;
|
||||||
for tgtlang in targetLanguages:
|
for tgtlang in targetLanguages:
|
||||||
translationBuffer[tgtlang] = gf_utils.getKLinearizations(grammar, tgtlang, [parsesBlock]).next();
|
translationBuffer[tgtlang] = gf_utils.getKLinearizations(grammar, tgtlang, [parsesBlock], K=bestK).next();
|
||||||
if bestK == 1:
|
if bestK == 1:
|
||||||
for tidx, translation in enumerate(translationBuffer[tgtlang]):
|
for tidx, translation in enumerate(translationBuffer[tgtlang]):
|
||||||
if postprocessor(translation[1]).strip():
|
if postprocessor(translation[1]).strip():
|
||||||
|
|||||||
Reference in New Issue
Block a user