EdinburghNLP/nematus

infinite loop when there is a single token "|"

monsieurzhang opened this issue · 1 comments

Hi,
I met this problem during decoding.
Since there is one sentence at WMT newstest13.fr:146
"Soins palliatifs - La meilleure façon de mourir . . . | Le Devoir"

Could you confirm that? Thanks.

w = [self._word_dicts[i][f] if f in self._word_dicts[i] else 1 for (i,f) in enumerate(w.split('|'))]

"|" is normally reserved as factor separator, but I've now added a condition to translate.py so that "|" in the input will be accepted if you don't use factored models.