Skip to content
Snippets Groups Projects
tokenmatch.h 1019 B
Newer Older
#ifndef LIBWCCL_VALUES_TOKENMATCH_H
#define LIBWCCL_VALUES_TOKENMATCH_H

#include <libwccl/values/matchdata.h>
class TokenMatch : public MatchData
{
public:

	explicit TokenMatch(Position position)
		: position_(position)
	{
		BOOST_ASSERT(position_.get_value() != Position::Nowhere);
	}

	explicit TokenMatch(int pos)
		: position_(pos)
	{
		BOOST_ASSERT(position_.get_value() != Position::Nowhere);
	}

	/// MatchData override.
	/// MatchData override.
	Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const {
	/// MatchData override.
	Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const {
	/// MatchData override
	std::string to_raw_string() const;

protected:
	/// MatchData override
	TokenMatch* clone_internal() const {
		return new TokenMatch(*this);
	}

private:
	Position position_;
};

} /* end ns Wccl */

#endif // LIBWCCL_VALUES_TOKENMATCH_H