mirror of
https://gitee.com/lionsoul/friso.git
synced 2024-12-02 03:07:52 +08:00
Friso-1.6.0:GBK支持,二次切分,自定义保留标点,bug修复,优化。
This commit is contained in:
parent
166cf1fa6c
commit
d6056a15e9
@ -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 );
|
||||
//}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user