File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/ImeWlConverterCore/IME Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ public string ExportLine(WordLibrary wl)
6464 {
6565 var sb = new StringBuilder ( ) ;
6666 var pinyin = wl . GetPinYinString ( "" , BuildType . None ) ;
67-
67+
6868 // 防御性检查: 确保拼音不为空
6969 if ( string . IsNullOrWhiteSpace ( pinyin ) || string . IsNullOrWhiteSpace ( wl . Word ) )
7070 {
7171 return null ; // 返回null表示跳过这个词条
7272 }
73-
73+
7474 sb . Append ( pinyin ) ;
7575 sb . Append ( "\t " ) ;
7676 sb . Append ( wl . Word ) ;
Original file line number Diff line number Diff line change @@ -53,14 +53,14 @@ public WordLibrary BuildWordLibrary(string line)
5353 new [ ] { UserDefiningPattern . SplitString } ,
5454 StringSplitOptions . RemoveEmptyEntries
5555 ) ;
56-
56+
5757 // 边界检查: 确保至少有一个元素
5858 if ( strlist . Length == 0 )
5959 {
6060 Debug . WriteLine ( $ "警告: 无效的行格式,分割后无元素: { line } ") ;
6161 return null ;
6262 }
63-
63+
6464 var newSort = new List < int > ( UserDefiningPattern . Sort ) ;
6565 newSort . Sort ( ) ;
6666 string code = "" ,
You can’t perform that action at this time.
0 commit comments