On 19/05/15 22:09, Kenneth Heafield wrote:
>>> There are non-traditional uses like ReadLine('\0') to read
>>> null-delimited tokens.
>>
>> While exploring this change I didn't find a single use of that parameter
>> in the Moses source tree!
>
> It's in some new code in KenLM master that I wouldn't feel bad about
> changing.
No need — just pass "false" for the strip_cr parameter.
>>> Also, how would you feel if I changed it to be FakeIFStream with
>>> operator>> extraction, at least for integer/float types?
>>
>> Sorry, I haven't looked into FakeIFStream at all yet, and I may not
>> fully understand the question.
>
> It doesn't exist yet. I am contemplating refactoring FilePiece to have
> operator>> and renaming it to FakeIFStream.
Any ideas on how you would map the different ways of reading into a
stream-style API? By adding manipulators? One thing I don't like about
those is that they require you to track and understand more stream state
to understand exactly what a piece of code does.
I do think turning the class into a stream will make code easier to
follow generally. On the flip side, it may make it harder to find out
which function is being called where. That matters when debugging the
finer points, as I've been doing with this carriage-return issue.
Jeroen
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support