|
a/src/common/textsplit.cpp |
|
b/src/common/textsplit.cpp |
|
... |
|
... |
16 |
* along with this program; if not, write to the
|
16 |
* along with this program; if not, write to the
|
17 |
* Free Software Foundation, Inc.,
|
17 |
* Free Software Foundation, Inc.,
|
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
19 |
*/
|
19 |
*/
|
20 |
#ifndef TEST_TEXTSPLIT
|
20 |
#ifndef TEST_TEXTSPLIT
|
|
|
21 |
#include "autoconfig.h"
|
21 |
|
22 |
|
22 |
#include <assert.h>
|
23 |
#include <assert.h>
|
23 |
|
24 |
|
24 |
#include <iostream>
|
25 |
#include <iostream>
|
25 |
#include <string>
|
26 |
#include <string>
|
|
... |
|
... |
448 |
// Handle like a normal separator
|
449 |
// Handle like a normal separator
|
449 |
goto SPACE;
|
450 |
goto SPACE;
|
450 |
}
|
451 |
}
|
451 |
break;
|
452 |
break;
|
452 |
|
453 |
|
|
|
454 |
#ifdef RCL_SPLIT_CAMELCASE
|
453 |
// Camelcase handling.
|
455 |
// Camelcase handling.
|
454 |
// If we get uppercase ascii after lowercase ascii, emit word.
|
456 |
// If we get uppercase ascii after lowercase ascii, emit word.
|
455 |
// This emits "camel" when hitting the 'C' of camelCase
|
457 |
// This emits "camel" when hitting the 'C' of camelCase
|
|
|
458 |
// Not enabled by defaults as this makes phrase searches quite
|
|
|
459 |
// confusing.
|
|
|
460 |
// ie "MySQL manual" is matched by "MySQL manual" and
|
|
|
461 |
// "my sql manual" but not "mysql manual"
|
456 |
case A_ULETTER:
|
462 |
case A_ULETTER:
|
457 |
if (m_span.length() &&
|
463 |
if (m_span.length() &&
|
458 |
charclasses[(unsigned char)m_span[m_span.length() - 1]] ==
|
464 |
charclasses[(unsigned char)m_span[m_span.length() - 1]] ==
|
459 |
A_LLETTER) {
|
465 |
A_LLETTER) {
|
460 |
if (m_wordLen) {
|
466 |
if (m_wordLen) {
|
|
... |
|
... |
481 |
return false;
|
487 |
return false;
|
482 |
m_wordStart--;
|
488 |
m_wordStart--;
|
483 |
m_wordLen++;
|
489 |
m_wordLen++;
|
484 |
}
|
490 |
}
|
485 |
goto NORMALCHAR;
|
491 |
goto NORMALCHAR;
|
|
|
492 |
#endif /* CAMELCASE */
|
486 |
|
493 |
|
487 |
|
494 |
|
488 |
default:
|
495 |
default:
|
489 |
NORMALCHAR:
|
496 |
NORMALCHAR:
|
490 |
m_wordLen += it.appendchartostring(m_span);
|
497 |
m_wordLen += it.appendchartostring(m_span);
|