ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/Ranker.cpp
(Generate patch)

Comparing trunk/Search/Ranker.cpp (file contents):
Revision 339 by Douglas Thrift, 2004-04-16T14:45:30-07:00 vs.
Revision 340 by Douglas Thrift, 2004-04-16T14:57:46-07:00

# Line 177 | Line 177 | void Ranker::setSample()
177  
178          string portion;
179          unsigned sampleLength = 0, begin = 0, end = string::npos;
180 <        while (sampleLength < 160 && itor != occurrencesText.end())
180 >        while (sampleLength < sampleMax && itor != occurrencesText.end())
181          {
182                  unsigned found = itor->first;
183                  unsigned length = itor->second;
# Line 185 | Line 185 | void Ranker::setSample()
185                  for (unsigned index = found; index > begin; index--)
186                  {
187                          if (index == begin) cerr << "Oh crap, I'm insane!\n";
188 <                        if (found - index >= 160 - sampleLength - length)
188 >                        if (found - index >= sampleMax - sampleLength - length)
189                          {
190                                  for (; index < found; index++)
191                                  {
# Line 230 | Line 230 | void Ranker::setSample()
230  
231                  if (++itor != occurrencesText.end())
232                  {
233 <                        if (itor->first + itor->second < begin + 160 - sampleLength)
233 >                        if (itor->first + itor->second < begin + sampleMax - sampleLength)
234                          {
235                                  portion = getText().substr(begin, itor->first - begin);
236                                  sampleLength += portion.length();
# Line 247 | Line 247 | void Ranker::setSample()
247                          }
248                          else
249                          {
250 <                                for (end = begin + 160 - sampleLength; end > begin; end--)
250 >                                for (end = begin + sampleMax - sampleLength; end > begin;
251 >                                        end--)
252                                  {
253                                          if (isspace(getText()[end])) break;
254                                  }
# Line 267 | Line 268 | void Ranker::setSample()
268                  }
269                  else
270                  {
271 <                        for (end = begin + 160 - sampleLength; end > begin && (end + 1 <
272 <                                getText().length()); end--)
271 >                        for (end = begin + sampleMax - sampleLength; end > begin && (end +
272 >                                1 < getText().length()); end--)
273                          {
274                                  if (isspace(getText()[end])) break;
275                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines