Skip to content

Commit

Permalink
fix(mspy_udl): 过滤掉含有非汉字的词条
Browse files Browse the repository at this point in the history
  • Loading branch information
nopdan authored May 10, 2024
1 parent 0cecf25 commit dc6b666
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/pinyin/mspy_udl.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,15 @@ func (f *MspyUDL) Unmarshal(r *bytes.Reader) []*Entry {
}

func (f *MspyUDL) Marshal(di []*Entry) []byte {
slices.DeleteFunc(di, func(v *Entry) bool {
for _, r := range v.Word {
if !unicode.Is(unicode.Han, r) {

Check failure on line 493 in pkg/pinyin/mspy_udl.go

View workflow job for this annotation

GitHub Actions / build

undefined: unicode
return true
}
}
return false
})

var buf bytes.Buffer
buf.Grow(0x2400 + 60*len(di))

Expand Down

0 comments on commit dc6b666

Please sign in to comment.