Skip to content
Snippets Groups Projects
mwereader.h 849 B
Newer Older
Bartosz Broda's avatar
Bartosz Broda committed
#ifndef LIBMWEREADER_MWEREADER_H
#define LIBMWEREADER_MWEREADER_H

#include <libcorpus2/io/reader.h>

namespace Corpus2 {


class MWEReader: public TokenReader
{
public:
	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;
};

} // ns Corpus2

#endif // LIBMWEREADER_MWEREADER_H