/**
* Init text collection
*
- * See CSA.h for more details.
*/
-TextCollectionBuilder::TextCollectionBuilder(unsigned samplerate)
+TextCollectionBuilder::TextCollectionBuilder(unsigned samplerate, ulong estimatedInputLength)
: p_(new struct TCBuilderRep())
{
p_->n = 0;
p_->numberOfTexts = 0;
p_->numberOfSamples = 0;
- // Current params: 8 bytes, 15 MB, no samples
- p_->sa = new CSA::RLCSABuilder(8, 0, 15 * 1024 * 1024);
+ // Current params: 8 bytes, no samples, buffer size n/10 bytes.
+ // Buffer size is always at least 15MB:
+ if (estimatedInputLength < TEXTCOLLECTION_DEFAULT_INPUT_LENGTH)
+ estimatedInputLength = TEXTCOLLECTION_DEFAULT_INPUT_LENGTH;
+ p_->sa = new CSA::RLCSABuilder(8, 0, estimatedInputLength/10);
assert(p_->sa->isOk());
#ifdef TCB_TEST_BWT
}
-TextCollection * TextCollectionBuilder::InitTextCollection()
+TextCollection * TextCollectionBuilder::InitTextCollection(char type)
{
uchar * bwt = 0;
CSA::usint length = 0;
}
TextCollection *result = new TCImplementation(bwt, (ulong)length,
- p_->samplerate, p_->numberOfTexts, p_->maxTextLength, p_->numberOfSamples);
+ p_->samplerate, p_->numberOfTexts, p_->maxTextLength, p_->numberOfSamples, type);
return result;
}