diff --git a/phrase/phrase_dict_add.go b/phrase/phrase_dict_add.go index d893dc8..67b0b35 100644 --- a/phrase/phrase_dict_add.go +++ b/phrase/phrase_dict_add.go @@ -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 } diff --git a/pinyin_dict_add.go b/pinyin_dict_add.go index bb809ae..f6ffd4e 100644 --- a/pinyin_dict_add.go +++ b/pinyin_dict_add.go @@ -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) +}