
#ifndef SYNSETCLASSSET_H_
#define SYNSETCLASSSET_H_

#include "../../../matrices/SuperMatrix.h"

#include "SynsetClass.h"

namespace smartcomparator
{
	namespace simfunctions
	{


class SynsetClassSet;

typedef boost::shared_ptr<SynsetClassSet> SynsetClassSetPtrS;


class SynsetClassSet {
private:
	SynsetClassByIdMap mClasses;

public:
	SynsetClassSet();
	SynsetClassSet( SynsetByIdMapPtrS& pTreesRoots );
	virtual ~SynsetClassSet();


	void initClassSet( SynsetByIdMapPtrS& pTreesRoots );

	void splitClasses(
		size_t	pDesiredClassNumber,
		float	pMinSizeSimilarity );

	ClassIdsSetByLemmasMapPtrS mapLemmasToClasses();

	/* CRS matrix only */
	Matrices::SuperMatrixPtr createFeatureMatrixFC(
		ClassIdsSetByLemmasMapPtrS&	pLemmasMapping,
		Matrices::SuperMatrixPtr& 	pFrequneciesMatrix );

	/* CRS matrix only */
	Matrices::SuperMatrixPtr createFeatureMatrixCF(
		ClassIdsSetByLemmasMapPtrS&	pLemmasMapping,
		Matrices::SuperMatrixPtr& 	pFrequneciesMatrix );


	SynsetClassByIdMap& getClassSet();

	size_t getSize() const;

private:
	void mapLemmasToClassesIR(
		SynsetPtrS& 					pSynset,
		size_t							pClassId,
		ClassIdsSetByLemmasMapPtrS& 	pMapping );

};

	}
}

#endif /* SYNSETCLASSSET_H_ */
