IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from zhpy import annotator from zhdc import twdict, cndict, revert_dict hexval = '0123456789abcdef' annotator() # make reverse traditional chinese dicts rev_twdict = revert_dict(twdict) # make reverse simplified chinese dicts rev_cndict = revert_dict(cndict) def rev_merger(anno_dict, use_dict, verbose=True): """ merge extra bindings into reverse dict >>> keys = [('遊戲', 'pygame'), ('系統', 'sys')] >>> rev_merger(keys, rev_twdict) add pygame=遊戲 add sys=系統 >>> 'pygame' in rev_twdict True
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from zhpy import annotator from zhdc import twdict, cndict, revert_dict hexval = '0123456789abcdef' annotator() # make reverse traditional chinese dicts rev_twdict = revert_dict(twdict) # make reverse simplified chinese dicts rev_cndict = revert_dict(cndict) def rev_merger(anno_dict, use_dict, verbose=True): """ merge extra bindings into reverse dict >>> keys = [('遊戲', 'pygame'), ('系統', 'sys')] >>> rev_merger(keys, rev_twdict) add pygame=遊戲 add sys=系統 >>> 'pygame' in rev_twdict True >>> keys = [('游戏', 'pygame'), ('系统', 'sys')]