link-grammar-5.8.0/link-grammar/dict-common/idiom.c
/**
 * Returns false if it is not a correctly formed idiom string.
 * Such a string is correct if it consists of non-empty strings
 * separated by '_'.
 */
Returns false if it is not a correctly formed idiom string.
Such a string is correct if it consists of non-empty strings
separated by '_'.
Returns false if it is not a correctly formed idiom string . Such a string is correct if it consists of non - empty strings separated by ' _ ' .
static bool is_idiom_string(const char * s)
{
	size_t len;
	const char * t;
	len = strlen(s);
	if ((s[0] == '_') || (s[len-1] == '_'))
	{
		return false;
	}
	for (t = s; *t != '\0'; t++)
	{
		if (*s == SUBSCRIPT_MARK) return true;
		if ((*t == '_') && (*(t+1) == '_')) return false;
	}
	return true;
}
static bool is_idiom_string ( const char * s ) { size_t len ; const char * t ; len = strlen ( s ) ; if ( ( s [ 0 ] == ' ' ) || ( s [ len - 1 ] == ' ' ) ) { return false ; } for ( t = s ; * t != ' \0 ' ; t ++ ) { if ( * s == SUBSCRIPT_MARK ) return true ; if ( ( * t == ' ' ) && ( * ( t + 1 ) == ' ' ) ) return false ; } return true ; }
Returns false if it is not a correctly formed idiom string.
Returns false if it is not a correctly formed idiom string .