add --enable-camelcase option to configure
This commit is contained in:
parent
1ab7ea0558
commit
69c27db46a
@ -44,5 +44,8 @@
|
|||||||
/* Use file extended attributes */
|
/* Use file extended attributes */
|
||||||
#undef RCL_USE_XATTR
|
#undef RCL_USE_XATTR
|
||||||
|
|
||||||
|
/* Split camelCase words */
|
||||||
|
#undef RCL_SPLIT_CAMELCASE
|
||||||
|
|
||||||
/* No X11 */
|
/* No X11 */
|
||||||
#undef WITHOUT_X11
|
#undef WITHOUT_X11
|
||||||
|
|||||||
@ -18,6 +18,7 @@ static char rcsid[] = "@(#$Id: textsplit.cpp,v 1.38 2008-12-12 11:53:45 dockes E
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#ifndef TEST_TEXTSPLIT
|
#ifndef TEST_TEXTSPLIT
|
||||||
|
#include "autoconfig.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -450,9 +451,14 @@ bool TextSplit::text_to_words(const string &in)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef RCL_SPLIT_CAMELCASE
|
||||||
// Camelcase handling.
|
// Camelcase handling.
|
||||||
// If we get uppercase ascii after lowercase ascii, emit word.
|
// If we get uppercase ascii after lowercase ascii, emit word.
|
||||||
// This emits "camel" when hitting the 'C' of camelCase
|
// This emits "camel" when hitting the 'C' of camelCase
|
||||||
|
// Not enabled by defaults as this makes phrase searches quite
|
||||||
|
// confusing.
|
||||||
|
// ie "MySQL manual" is matched by "MySQL manual" and
|
||||||
|
// "my sql manual" but not "mysql manual"
|
||||||
case A_ULETTER:
|
case A_ULETTER:
|
||||||
if (m_span.length() &&
|
if (m_span.length() &&
|
||||||
charclasses[(unsigned char)m_span[m_span.length() - 1]] ==
|
charclasses[(unsigned char)m_span[m_span.length() - 1]] ==
|
||||||
@ -483,6 +489,7 @@ bool TextSplit::text_to_words(const string &in)
|
|||||||
m_wordLen++;
|
m_wordLen++;
|
||||||
}
|
}
|
||||||
goto NORMALCHAR;
|
goto NORMALCHAR;
|
||||||
|
#endif /* CAMELCASE */
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
6890
src/configure
vendored
6890
src/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -154,6 +154,25 @@ if test X$xattrEnabled = Xyes ; then
|
|||||||
AC_DEFINE(RCL_USE_XATTR, 1, [Use file extended attributes])
|
AC_DEFINE(RCL_USE_XATTR, 1, [Use file extended attributes])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable CamelCase word splitting. This is optional because it causes
|
||||||
|
# problems with phrases: with camelcase enabled, "MySQL manual"
|
||||||
|
# will be matched by "MySQL manual" and "my sql manual" but not
|
||||||
|
# "mysql manual" (which would need increased slack as manual is now at pos
|
||||||
|
# 2 instead of 1
|
||||||
|
AC_ARG_ENABLE(camelcase,
|
||||||
|
AC_HELP_STRING([--enable-camelcase],
|
||||||
|
[Enable splitting camelCase words. This is not enabled by default as
|
||||||
|
this makes phrase matches more difficult: you need to use matching
|
||||||
|
case in the phrase query to get a match. Ie querying for
|
||||||
|
"MySQL manual" and "my sql manual" are the same, but not the same as
|
||||||
|
"mysql manual" (in phrases only and you could raise the phrase slack to
|
||||||
|
get a match).]),
|
||||||
|
camelcaseEnabled=$enableval, camelcaseEnabled=no)
|
||||||
|
|
||||||
|
if test X$camelcaseEnabled = Xyes ; then
|
||||||
|
AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS(mkdtemp)
|
AC_CHECK_FUNCS(mkdtemp)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user