fix:dsl dictionary parse.

This commit is contained in:
yifang 2022-03-03 00:26:21 +08:00
parent c9d053d227
commit 2a08b6290e
2 changed files with 8 additions and 0 deletions

View file

@ -1153,6 +1153,12 @@ void expandOptionalParts( wstring & str, list< wstring > * result,
list< wstring > * headwords; list< wstring > * headwords;
headwords = inside_recurse ? result : &expanded; headwords = inside_recurse ? result : &expanded;
//if str is too long ,it can never be headwords.
//todo?
if( str.size() > 100 )
{
return;
}
for( ; x < str.size(); ) for( ; x < str.size(); )
{ {
wchar ch = str[ x ]; wchar ch = str[ x ];

View file

@ -622,6 +622,8 @@ wstring trimWhitespaceOrPunct( wstring const & in )
wstring trimWhitespace( wstring const & in ) wstring trimWhitespace( wstring const & in )
{ {
if( in.empty() )
return in;
wchar const * wordBegin = in.c_str(); wchar const * wordBegin = in.c_str();
wstring::size_type wordSize = in.size(); wstring::size_type wordSize = in.size();