/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>

#include "../wsd.h"
#include "../wsdreader.h"
#include <libcorpus2/tagsetmanager.h>

BOOST_AUTO_TEST_SUITE( wsd_functional );

struct Fixture{
	Fixture()
	{
		fill_sentences();

	}
	virtual void fill_sentences()
	{

	#ifdef WSD_READER_TEST_DATA_DIR
		data_dir = boost::filesystem::path(WSD_READER_TEST_DATA_DIR);
		data_dir /= "data";

	#else
		boost::filesystem::path data_dir("data");
	#endif
		test_corpus = "/home/lukasz/test1.kipi.xml";

	}
	boost::filesystem::path test_corpus, data_dir;

};





BOOST_FIXTURE_TEST_CASE( fix_no_gap , Fixture)
{
	BOOST_MESSAGE("=====================\ntest: finding fixed wsd");
	const Corpus2::Tagset& tset = Corpus2::get_named_tagset("kipi");
	Corpus2::WSDReader mwr(tset, test_corpus.string());
	mwr.set_option("inner:xces");
	//mwr.set_option("wsdfile:"+ (data_dir / "fix_mwe.xml").string());
	Corpus2::Sentence::Ptr s1 = mwr.get_next_sentence();
	s1 = mwr.get_next_sentence();
	s1 = mwr.get_next_sentence();
	Corpus2::Token* mwu = s1->operator[](4);
	std::cout << "BASE: " << mwu->orth_utf8() << std::endl;
//	BOOST_CHECK(mwu->orth_utf8() == "dobrej woli");
//	BOOST_CHECK(mwu->get_preferred_lexeme(tset).lemma_utf8() == "dobra wola");

}

BOOST_FIXTURE_TEST_CASE( get_next_chunk, Fixture)
{
	const Corpus2::Tagset& tset = Corpus2::get_named_tagset("kipi");
	Corpus2::WSDReader mwr1(tset, test_corpus.string());
	mwr1.set_option("inner:xces");
//	mwr1.set_option("mwefile:"+ (data_dir / "fix_mwe.xml").string());

	mwr1.get_next_chunk();
	mwr1.get_next_chunk();
//	BOOST_CHECK(mwr1.get_next_chunk()!=NULL);
//	BOOST_CHECK(mwr1.get_next_chunk()==NULL);
}




//Check NULL



BOOST_AUTO_TEST_SUITE_END()
