mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
fix pair object in dict problem
This commit is contained in:
parent
4f8ca83661
commit
e5e41a4aad
@ -84,6 +84,12 @@ class pair(object):
|
||||
def __lt__(self, other):
|
||||
return self.word < other.word
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, pair) and self.word == other.word and self.flag == other.flag
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.word)
|
||||
|
||||
def encode(self, arg):
|
||||
return self.__unicode__().encode(arg)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user