/* $Id: wrapperdiscardlists.h 5146 2010-03-24 23:05:57Z abehm $ Copyright (C) 2010 by The Regents of the University of California Redistribution of this file is permitted under the terms of the Academic BSD License. Date: 09/06/2008 Author: Alexander Behm */ #ifndef _wrapperdiscardlists_h_ #define _wrapperdiscardlists_h_ #include "wrapperabs.h" #include "../ftindexerdiscardlists.h" template class WrapperDiscardListsLLF : public WrapperAbs, FtSearcherMem >, SimilarityMetric> { public: WrapperDiscardListsLLF(StringContainerVector* strContainer, unsigned gramLength = 3, bool usePartFilter = true, float compressionRatio = 0.5, bool usePrePost = true) { this->gramGen = new GramGenFixedLen(gramLength, usePrePost); this->indexer = new FtIndexerDiscardListsLLF<>(strContainer, this->gramGen, compressionRatio); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >(&this->merger, this->indexer); this->simMetric = new SimilarityMetric(*(this->gramGen)); } }; template class WrapperDiscardListsSLF : public WrapperAbs, FtSearcherMem >, SimilarityMetric> { public: WrapperDiscardListsSLF(StringContainerVector* strContainer, unsigned gramLength = 3, bool usePartFilter = true, float compressionRatio = 0.5, bool usePrePost = true) { this->gramGen = new GramGenFixedLen(gramLength, usePrePost); this->indexer = new FtIndexerDiscardListsSLF<>(strContainer, this->gramGen, compressionRatio); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >(&this->merger, this->indexer); this->simMetric = new SimMetricEd(*(this->gramGen)); } }; template class WrapperDiscardListsRandom : public WrapperAbs, FtSearcherMem >, SimilarityMetric> { public: WrapperDiscardListsRandom(StringContainerVector* strContainer, unsigned gramLength = 3, bool usePartFilter = true, float compressionRatio = 0.5, bool usePrePost = true) { this->gramGen = new GramGenFixedLen(gramLength, usePrePost); this->indexer = new FtIndexerDiscardListsRandom<>(strContainer, this->gramGen, compressionRatio); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >(&this->merger, this->indexer); this->simMetric = new SimMetricEd(*(this->gramGen)); } }; template class WrapperDiscardListsPanicCost : public WrapperAbs, FtSearcherMem >, SimilarityMetric>{ public: WrapperDiscardListsPanicCost(StringContainerVector* strContainer, vector* workload, float optimizeThreshold, unsigned gramLength = 3, bool usePartFilter = true, float reductionRatio = 0.5, bool usePrePost = true) { this->gramGen = new GramGenFixedLen(gramLength, usePrePost); this->simMetric = new SimMetricEd(*(this->gramGen)); this->indexer = new FtIndexerDiscardListsPanicCost<>(strContainer, this->gramGen, reductionRatio, workload, this->simMetric, optimizeThreshold); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >(&this->merger, this->indexer); } }; template class WrapperDiscardListsTimeCost : public WrapperAbs, FtSearcherMem >, SimilarityMetric> { public: WrapperDiscardListsTimeCost(StringContainerVector* strContainer, vector* workload, float optimizeThreshold, unsigned gramLength = 3, bool usePartFilter = true, float reductionRatio = 0.5, bool usePrePost = true) { this->gramGen = new GramGenFixedLen(gramLength, usePrePost); this->simMetric = new SimMetricEd(*(this->gramGen)); this->indexer = new FtIndexerDiscardListsTimeCost<>(strContainer, this->gramGen, reductionRatio, workload, this->simMetric, optimizeThreshold); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >(&this->merger, this->indexer); } }; #endif