#ifndef LIBMWEREADER_MWEREADER_H #define LIBMWEREADER_MWEREADER_H #include <libcorpus2/io/reader.h> namespace Corpus2 { class MWEReader: public TokenReader { public: /** * \param filename corpus filename (MWE file is given in options) */ MWEReader(const Tagset& tagset, const std::string& filename); ~MWEReader(); Token* get_next_token(); Sentence::Ptr get_next_sentence(); boost::shared_ptr<Chunk> get_next_chunk(); void set_option(const std::string& option); /** * Option inspector. Should echo the option if it is set, return * an empty string otheriwse, and "unknown" if the option is invalid. */ std::string get_option(const std::string& option) const; /** * Check if the reader is valid, should throw if not. Called after * all set_options during factory reader creation. */ virtual void validate(); static bool registered; private: /// ptr to inner reader doing the real work of reading a corpus TokenReaderPtr inner_reader_; /// path for inner reader std::string inner_filename_; /// inner reader option }; } // ns Corpus2 #endif // LIBMWEREADER_MWEREADER_H