Debug swcsa
[SXSI/TextCollection.git] / TextCollectionBuilder.cpp
1 #include "TextCollectionBuilder.h"
2 #include "FMIndexBuilder.h"
3 #include "SWCSABuilder.h"
4 #include "RLCSABuilder.h"
5
6 namespace SXSI
7 {
8 TextCollectionBuilder* TextCollectionBuilder::create(unsigned samplerate, 
9                                      index_type_t type,
10                                      ulong estimatedInputLength)
11 {
12     switch (type)
13     {
14     case index_type_default:
15         return new FMIndexBuilder(samplerate, estimatedInputLength);
16         break;
17     case index_type_swcsa:
18         return new SWCSABuilder(samplerate);
19         break;
20     case index_type_rlcsa:
21         return new RLCSABuilder(samplerate, estimatedInputLength);
22         break;
23     }
24     std::cerr << "TextCollectionBuilder::create(): unknown type given: expecting enum value, type = " << type << std::endl;
25     std::exit(2);
26 }
27
28 } // Namespace SXSI