Friso-1.6.0:GBK支持,二次切分,自定义保留标点,bug修复,优化。

This commit is contained in:
狮子的魂 2013-12-28 18:18:58 +08:00
parent 166cf1fa6c
commit d6056a15e9

View File

@ -448,30 +448,31 @@ FRISO_API int utf8_other_number( uint_t u )
/* {{{
'@', '$','%', '^', '&', '-', ':', '.', '/', '\'', '#', '+'
*/
static friso_hash_t __keep_punctuations_hash__ = NULL;
//static friso_hash_t __keep_punctuations_hash__ = NULL;
/*check the given char is an english keep punctuation.*/
FRISO_API int utf8_keep_punctuation( fstring str )
{
if ( __keep_punctuations_hash__ == NULL )
{
__keep_punctuations_hash__ = new_hash_table();
hash_put_mapping( __keep_punctuations_hash__, "@", NULL );
//hash_put_mapping( __keep_punctuations_hash__, "$", NULL );
hash_put_mapping( __keep_punctuations_hash__, "%", NULL );
//hash_put_mapping( __keep_punctuations_hash__, "^", NULL );
hash_put_mapping( __keep_punctuations_hash__, "&", NULL );
//hash_put_mapping( __keep_punctuations_hash__, "-", NULL );
//hash_put_mapping( __keep_punctuations_hash__, ":", NULL );
hash_put_mapping( __keep_punctuations_hash__, ".", NULL );
//hash_put_mapping( __keep_punctuations_hash__, "/", NULL );
hash_put_mapping( __keep_punctuations_hash__, "'", NULL );
hash_put_mapping( __keep_punctuations_hash__, "#", NULL );
hash_put_mapping( __keep_punctuations_hash__, "+", NULL );
}
//check the hash.
return hash_exist_mapping( __keep_punctuations_hash__, str );
}
/* @Deprecated
* check the given char is an english keep punctuation.*/
//FRISO_API int utf8_keep_punctuation( fstring str )
//{
// if ( __keep_punctuations_hash__ == NULL )
// {
// __keep_punctuations_hash__ = new_hash_table();
// hash_put_mapping( __keep_punctuations_hash__, "@", NULL );
// //hash_put_mapping( __keep_punctuations_hash__, "$", NULL );
// hash_put_mapping( __keep_punctuations_hash__, "%", NULL );
// //hash_put_mapping( __keep_punctuations_hash__, "^", NULL );
// hash_put_mapping( __keep_punctuations_hash__, "&", NULL );
// //hash_put_mapping( __keep_punctuations_hash__, "-", NULL );
// //hash_put_mapping( __keep_punctuations_hash__, ":", NULL );
// hash_put_mapping( __keep_punctuations_hash__, ".", NULL );
// //hash_put_mapping( __keep_punctuations_hash__, "/", NULL );
// hash_put_mapping( __keep_punctuations_hash__, "'", NULL );
// hash_put_mapping( __keep_punctuations_hash__, "#", NULL );
// hash_put_mapping( __keep_punctuations_hash__, "+", NULL );
// }
// //check the hash.
// return hash_exist_mapping( __keep_punctuations_hash__, str );
//}
/* }}} */
/*