Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] tot_len_ratio being inf when src.size() is zero #39

Open
zaemyung opened this issue Jan 10, 2019 · 0 comments
Open

[BUG] tot_len_ratio being inf when src.size() is zero #39

zaemyung opened this issue Jan 10, 2019 · 0 comments

Comments

@zaemyung
Copy link

Thanks for creating and maintaining this useful tool!

I'd like to report a bug in the following lines: fast_align.cc#L261~L264.

*tot_len_ratio += static_cast<double>(trg.size()) / static_cast<double>(src.size());

When src.size() is zero, inf is added to *tot_len_ratio. This, in turn, sets mean_srclen_multiplier to inf (fast_align.cc#L291), and subsequently log_prob to inf.

I think this can be avoided by adding a continue; statement when src.size() is zero.
Hope this helps!

zaemyung pushed a commit to zaemyung/fast_align that referenced this issue Jan 10, 2019
Resolves ["[BUG] tot_len_ratio being inf when src.size() is zero"](clab#39) by skipping lines with zero length.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant