Skip to content

Commit

Permalink
support add and remove pinyin dictionary function
Browse files Browse the repository at this point in the history
  • Loading branch information
vcaesar committed Oct 3, 2021
1 parent 1fde2e5 commit 462dde2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phrase/phrase_dict_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var DictAdd = map[string]string{
"着重": "zhuó zhòng",
}

// AddDict adds a token into phrase dictionary.
// AddDict add a token into phrase dictionary.
func AddDict(text, py string) {
DictAdd[text] = py
}
Expand Down
10 changes: 10 additions & 0 deletions pinyin_dict_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ package gpy
var PinyinDictAdd = map[int]string{
0: "",
}

// AddDict add a token into pinyin dictionary.
func AddDict(text int, py string) {
PinyinDictAdd[text] = py
}

// Remove remove a token from pinyin dictionary.
func Remove(text int) {
delete(PinyinDictAdd, text)
}

0 comments on commit 462dde2

Please sign in to comment.