/* phonetic.c - routines to do phonetic matching */
+/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include "slap.h"
-#if !defined(METAPHONE) && !defined(SLAPD_PHONETIC)
-#define METAPHONE
+#if !defined(SLAPD_METAPHONE) && !defined(SLAPD_PHONETIC)
+#define SLAPD_METAPHONE
#endif
#define iswordbreak(x) (!isascii(x) || isspace((unsigned char) (x)) || \
ispunct((unsigned char) (x)) || \
isdigit((unsigned char) (x)) || (x) == '\0')
-char *
+static char *
first_word( char *s )
{
if ( s == NULL ) {
return( s );
}
-char *
+static char *
next_word( char *s )
{
if ( s == NULL ) {
return( s );
}
-char *
+static char *
word_dup( char *w )
{
char *s, *ret;
return( ch_strdup( phoneme ) );
}
-#else
-#if defined(METAPHONE)
+#elif defined(SLAPD_METAPHONE)
+/*
+ * Metaphone was originally developed by Lawrence Philips and
+ * published in the "Computer Language" magazine in 1990.
+ */
/*
* Metaphone copied from C Gazette, June/July 1991, pp 56-57,
* author Gary A. Parker, with changes by Bernard Tiffany of the
return( ch_strdup( buf ) );
}
-#endif /* metaphone */
-#endif /* SLAPD_PHONETIC */
+#endif /* SLAPD_METAPHONE */