
#ifndef SYNSETCLASS_H_
#define SYNSETCLASS_H_

#include "Synset.h"

namespace smartcomparator
{
	namespace simfunctions
	{


class SynsetClass;

typedef boost::shared_ptr<SynsetClass>			SynsetClassPtrS;
typedef std::map<size_t, SynsetClassPtrS> 		SynsetClassByIdMap;
typedef boost::shared_ptr<SynsetClassByIdMap>	SynsetClassByIdMapPtrS;

typedef std::set<size_t>							ClassIdsSet;
typedef boost::shared_ptr<ClassIdsSet>				ClassIdsSetPtrS;
typedef std::map<std::string, ClassIdsSetPtrS>		ClassIdsSetByLemmasMap;
typedef boost::shared_ptr<ClassIdsSetByLemmasMap>	ClassIdsSetByLemmasMapPtrS;

class SynsetClass {
private:
	size_t			mId;
	SynsetByIdMap 	mTrees;
	size_t			mSize;
	size_t			mLemmasCount;

public:
	SynsetClass( size_t pId );
	virtual ~SynsetClass();

	SynsetClassPtrS split(
		size_t	pNewClassId,
		float	pMinSizeSimilarity );

	SynsetByIdMap& getTreesEditable();

	size_t getTreesNumber() const;
	size_t getSize()		const;
	size_t getId()			const;
	size_t getLemmasCount()	const;

	void recomputeSize();
	void recomputeSizeAndNodesCount();

	void 		print() const;
	std::string	dumb() 	const;
};


class SynsetClassComparator {
public:
	bool operator()( SynsetClassPtrS const& lhs, SynsetClassPtrS const& rhs ) const {
		return ( lhs->getSize() < rhs->getSize() );
	}
};


	}
}

#endif /* SYNSETCLASS_H_ */
