/* $Id: wrappersimple.h 5756 2010-10-12 04:21:00Z abehm $ Copyright (C) 2010 by The Regents of the University of California Redistribution of this file is permitted under the terms of the BSD license. Date: 09/06/2008 Author: Alexander Behm */ #ifndef _wrappersimple_h_ #define _wrappersimple_h_ #include "wrapperabs.h" template class WrapperSimple : public WrapperAbs, FtSearcherMem<>, SimilarityMetric> { public: WrapperSimple(StringContainerVector* strContainer, GramGen* gramGen, bool usePartFilter = true) { this->gramGen = gramGen; this->indexer = new FtIndexerMem<>(strContainer, this->gramGen); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem<>(&this->merger, this->indexer); if(!this->simAlloc) { this->simMetric = new SimilarityMetric(*(this->gramGen)); this->simAlloc = true; } } }; template class WrapperShortSimple : public WrapperShortAbs >, FtSearcherMem >, MergeOptMerger > >, SimilarityMetric> { public: WrapperShortSimple(StringContainerVector* strContainer, GramGen* gramGen, bool usePartFilter = true) { this->gramGen = gramGen; this->indexer = new FtIndexerMem >(strContainer, this->gramGen); if(usePartFilter) this->indexer->autoAddPartFilter(); this->searcher = new FtSearcherMem >, MergeOptMerger > >(&this->merger, this->indexer); if(!this->simAlloc) { this->simMetric = new SimilarityMetric(*(this->gramGen)); this->simAlloc = true; } } }; #endif