link-grammar-5.8.0/link-grammar/dict-common/idiom.c
/**
 * Find if a string signifies an idiom.
 * Returns true if the string contains an underbar character.
 * The check of s[0] prevents inclusion of '_'. In that case no check for
 * length=1 is done because it is not going to be a valid idiom anyway.
 *
 * If the underbar character is preceded by a backslash, it is not
 * considered. The subscript, if exists, is not checked.
 *
 * FIXME: Words with '\' escaped underbars that contain also unescaped
 * ones are not supported.
 */
Find if a string signifies an idiom.
Returns true if the string contains an underbar character.
The check of s[0] prevents inclusion of '_'. In that case no check for
length=1 is done because it is not going to be a valid idiom anyway.

If the underbar character is preceded by a backslash, it is not
considered. The subscript, if exists, is not checked.

Words with '\' escaped underbars that contain also unescaped
ones are not supported.
Find if a string signifies an idiom . Returns true if the string contains an underbar character . The check of s [ 0 ] prevents inclusion of ' _ ' . In that case no check for length = 1 is done because it is not going to be a valid idiom anyway . If the underbar character is preceded by a backslash it is not considered . The subscript if exists is not checked . Words with ' \ ' escaped underbars that contain also unescaped ones are not supported .
bool contains_underbar(const char * s)
{
	if ((s[0] == '_') || (s[0] == '\0')) return false;
	while (*++s != '\0')
	{
		if (*s == SUBSCRIPT_MARK) return false;
		if ((*s == '_') && (s[-1] != '\\')) return true;
	}
	return false;
}
bool contains_underbar ( const char * s ) { if ( ( s [ 0 ] == ' ' ) || ( s [ 0 ] == ' \0 ' ) ) return false ; while ( * ++ s != ' \0 ' ) { if ( * s == SUBSCRIPT_MARK ) return false ; if ( ( * s == ' ' ) && ( s [ -1 ] != ' \\ ' ) ) return true ; } return false ; }
Find if a string signifies an idiom.
Find if a string signifies an idiom .