#include <parser.h>
Public Types | |
| typedef std::vector< size_t > | parsed_counter_t |
| Container holds numbers of words in each sentence (recently) parsed. | |
Public Member Functions | |
| Parser (std::ifstream &input_file) | |
| Constructor attach Parser to given input file ifstream object. | |
| bool | eof (void) const |
| const parsed_counter_t & | parsed (void) const |
| bool | next (size_t count, ContextWindow::Mode mode, words_store_t &store) |
| Parse and push next sentence(s). | |
Private Attributes | |
| std::ifstream & | _input_file |
| Reference to file to be parsed. | |
| size_t | _line_no |
| Line numbers counter. | |
| parsed_counter_t | _parsed_counter |
| Parsed words and sentences counter (its value changes by every call to next(size_t, ContextWindow::Mode, words_store_t&). | |
Then parses the file by steps, which are determined by calls to next(size_t, ContextWindow::Mode, words_store_t&) method.
| typedef std::vector<size_t> ace::Parser::parsed_counter_t |
Container holds numbers of words in each sentence (recently) parsed.
| ace::Parser::Parser | ( | std::ifstream & | input_file | ) | [inline] |
Constructor attach Parser to given input file ifstream object.
| input_file | Reference to (already open!) file to be parsed. |
| bool ace::Parser::eof | ( | void | ) | const [inline] |
| const parsed_counter_t& ace::Parser::parsed | ( | void | ) | const [inline] |
| bool ace::Parser::next | ( | size_t | count, | |
| ContextWindow::Mode | mode, | |||
| words_store_t & | store | |||
| ) |
Parse and push next sentence(s).
The number of sentences parsed depends on count and mode params and on the current position of filestream pointer (no parsing may be performed behind the end of file:).
| count | Number of units to parse (unit type is determined by `mode`). | |
| mode | One of ContextWindow::Mode values. | |
| store | Reference to container to push parsed words in. |
std::ifstream& ace::Parser::_input_file [private] |
Reference to file to be parsed.
size_t ace::Parser::_line_no [private] |
Line numbers counter.
parsed_counter_t ace::Parser::_parsed_counter [private] |
Parsed words and sentences counter (its value changes by every call to next(size_t, ContextWindow::Mode, words_store_t&).
1.5.6