Minimum buffer size
authornvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 19 May 2009 14:14:54 +0000 (14:14 +0000)
committernvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 19 May 2009 14:14:54 +0000 (14:14 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@405 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

TextCollectionBuilder.cpp

index 1d49f39..7228f72 100644 (file)
@@ -43,6 +43,9 @@ TextCollectionBuilder::TextCollectionBuilder(unsigned samplerate, ulong estimate
     p_->numberOfSamples = 0;
     
     // 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());