-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add SimpleStringEmission and re-enable GaussianEmission test #51
Conversation
return; | ||
} | ||
|
||
if (clean[0] == dirty[0]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clever and it took me a little while to understand. Consider adding some explanatory comments to the first couple blocks like "Check equality of string prefixes" before line 50 and "Check equality of string suffixes" before line 66.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
cxx/emissions/simple_string.hh
Outdated
if (mode == '\0') { | ||
return clean; | ||
} | ||
clean = clean + mode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably inconsequential but IMO might as well use +=
since it calls append
instead of copying the string (https://stackoverflow.com/questions/611263/efficient-string-concatenation-in-c/30401747#30401747)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ss.incorporate(std::make_pair<std::string, std::string>("world", "w0rld!")); | ||
BOOST_TEST(ss.N == 2); | ||
|
||
BOOST_TEST(ss.logp(std::make_pair<std::string, std::string>("test", "tst")) < 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd expect logp("test", "te$t") > logp("test", "tst")
since one substitution and no deletions are incorporated, right? Could you add a test like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
No description provided.