File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import zipfile
55
66OPENHOWNET_DATA_URL = "https://thunlp.oss-cn-qingdao.aliyuncs.com/OpenHowNet/resources.zip"
7- OPENHOWNET_RESOURCE_PATH = os .path .join ("~" , ".openhownet" )
7+ OPENHOWNET_RESOURCE_PATH = os .path .join (os . path . expanduser ( '~' ) , ".openhownet" )
88
99
1010def get_resource (path , mode = 'r' , encoding = 'utf-8' ):
@@ -53,7 +53,7 @@ def download():
5353 The HowNet resource file is openhownet_data.zip.
5454 '''
5555 if not os .path .exists (os .path .join (OPENHOWNET_RESOURCE_PATH , 'resources' )):
56- os .mkdir (os .path .join (OPENHOWNET_RESOURCE_PATH , 'resources' ))
56+ os .makedirs (os .path .join (OPENHOWNET_RESOURCE_PATH , 'resources' ))
5757 data_zip_path = download_file (
5858 OPENHOWNET_DATA_URL , dest_file = os .path .join ("resources" , "resources.zip" ))
5959 with zipfile .ZipFile (data_zip_path , 'r' ) as zip_ref :
You can’t perform that action at this time.
0 commit comments