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

Function open_dict

stardict.py:1748–1755  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

1746
1747# 根据文件名自动判断数据库类型并打开
1748def open_dict(filename):
1749 if isinstance(filename, dict):
1750 return DictMySQL(filename)
1751 if filename[:8] == 'mysql://':
1752 return DictMySQL(filename)
1753 if os.path.splitext(filename)[-1].lower() in ('.csv', '.txt'):
1754 return DictCsv(filename)
1755 return StarDict(filename)
1756
1757
1758# 字典转化,csv sqlite之间互转

Callers 2

convert_dictFunction · 0.85
open_localFunction · 0.85

Calls 3

DictMySQLClass · 0.85
DictCsvClass · 0.85
StarDictClass · 0.85

Tested by

no test coverage detected