MCPcopy
hub / github.com/skywind3000/ECDICT / register

Method register

stardict.py:945–957  ·  view source on GitHub ↗
(self, word, items, commit = True)

Source from the content-addressed store, hash-verified

943
944 # 注册新单词
945 def register (self, word, items, commit = True):
946 if word.lower() in self.__words:
947 return False
948 row = self.__obj_encode(items)
949 row[0] = word
950 row[COLUMN_ID] = len(self.__rows)
951 row[COLUMN_SD] = len(self.__rows)
952 row[COLUMN_SW] = stripword(word)
953 self.__rows.append(row)
954 self.__index.append(row)
955 self.__words[word.lower()] = row
956 self.__dirty = True
957 return True
958
959 # 删除单词
960 def remove (self, key, commit = True):

Callers 5

test3Function · 0.95
discrepancy_importMethod · 0.45
set_detailMethod · 0.45
tab_txt_importMethod · 0.45
convert_dictFunction · 0.45

Calls 2

__obj_encodeMethod · 0.95
stripwordFunction · 0.85

Tested by

no test coverage detected