diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-01-18 17:12:51 +0000 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-01-18 17:12:51 +0000 |
commit | 0b9031042500d45a098762f0a930bd6a66a58fac (patch) | |
tree | 38903f3e29225aa8d444ee66b6963c7148050fee /klm/util/stream/line_input.hh | |
parent | 9d7167751a3712a79ad356764d803106a71ce5e3 (diff) |
KenLM dffafbf with lmplz source (but not built)
Diffstat (limited to 'klm/util/stream/line_input.hh')
-rw-r--r-- | klm/util/stream/line_input.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/klm/util/stream/line_input.hh b/klm/util/stream/line_input.hh new file mode 100644 index 00000000..86db1dd0 --- /dev/null +++ b/klm/util/stream/line_input.hh @@ -0,0 +1,22 @@ +#ifndef UTIL_STREAM_LINE_INPUT__ +#define UTIL_STREAM_LINE_INPUT__ +namespace util {namespace stream { + +class ChainPosition; + +/* Worker that reads input into blocks, ensuring that blocks contain whole + * lines. Assumes that the maximum size of a line is less than the block size + */ +class LineInput { + public: + // Takes ownership upon thread execution. + explicit LineInput(int fd); + + void Run(const ChainPosition &position); + + private: + int fd_; +}; + +}} // namespaces +#endif // UTIL_STREAM_LINE_INPUT__ |