@@ -32,7 +32,7 @@ def fixes_spell():
3232 new_path = './Clover四叶草拼音new'
3333 if not os .path .exists (new_path ):
3434 os .mkdir (f'{ new_path } ' )
35-
35+
3636 exists_file = list ()
3737 for file_now in os .listdir (path ):
3838 curr_path = os .path .join (path , file_now )
@@ -267,14 +267,9 @@ def generatePinyins(keyword, pinyinStyle=PinyinStyle.TONE_POLYPHONE_WITH_PHRASE)
267267 #pinyinList = pinyin(keyword, style=Style.NORMAL, heteronym=True)
268268 pinyins = list ()
269269 try :
270- < << << << HEAD
271- pinyinList = getPinyin (keyword )
272- #print(pinyinList)
273- == == == =
274270 pinyinList = pdb .getPinyin (keyword , pinyinStyle )
275271 #print(pinyinList)
276272 pinyinList = getSinglePinyins (keyword , pinyinList )
277- >> >> >> > 6 b0f6ce91106b15c493322beb0bd93014502c988
278273 currPinyin = list ()
279274 firstPinyin = 1
280275 for curr_index in range (len (pinyinList [0 ])):
@@ -289,7 +284,7 @@ def generatePinyins(keyword, pinyinStyle=PinyinStyle.TONE_POLYPHONE_WITH_PHRASE)
289284def fixesBigDictErrorsWithMultiplePinyin ():
290285 path = './Clover四叶草拼音'
291286 new_path = './Clover四叶草拼音new'
292-
287+
293288 if not os .path .exists (new_path ):
294289 os .mkdir (f'{ new_path } ' )
295290 for file_now in os .listdir (path ):
@@ -328,7 +323,7 @@ def fixesBigDictErrorsWithMultiplePinyin():
328323def generateCloverPinyins ():
329324 path = './Clover四叶草拼音'
330325 new_path = './Clover四叶草拼音new'
331-
326+
332327 if not os .path .exists (new_path ):
333328 os .mkdir (f'{ new_path } ' )
334329 for file_now in os .listdir (path ):
@@ -344,10 +339,6 @@ def generateCloverPinyins():
344339 elif "\t " in line :
345340 keyword = line .split ('\t ' )[0 ]
346341 pinyin_old = line .split ('\t ' )[1 ].strip ()
347- < << << << HEAD
348- print ([pinyin_old ])
349- pinyin_list = generatePinyins (keyword )
350- == == == =
351342 count_str = line .split ('\t ' )[- 1 ].strip ().replace (" " , '' ).replace ("?" , '' )
352343 keyPinyinDict = dict ()
353344 for key in keyword :
@@ -360,7 +351,6 @@ def generateCloverPinyins():
360351 keyPinyinDict [key ][plainPinyins [i ]] = weights [i ]
361352 #print([pinyin_old])
362353 pinyin_list = generatePinyins (keyword , pinyinStyle = PinyinStyle .PLAIN_POLYPHONE_WITH_PHRASE )
363- >> >> >> > 6 b0f6ce91106b15c493322beb0bd93014502c988
364354 #print(pinyin_list)
365355 if len (pinyin_list ) == 0 :
366356 new_file .write (line )
@@ -380,15 +370,6 @@ def generateCloverPinyins():
380370 ratio = []
381371 pinyin = " " .join (pinyin ).split (" " )
382372 currPinyin = " " .join (pinyin )
383- < << << << HEAD
384- newLine = line .replace (pinyin_old , currPinyin )
385- #if currPinyin == pinyin_old:
386- if newLine == line :
387- print ([currPinyin ])
388- print ()
389- new_file .write (newLine )
390- new_file .flush ()
391- == == == =
392373 for i in range (len (pinyin )):
393374 if keyword [i ] not in pdb .homographWeightDict :
394375 pass
@@ -409,7 +390,6 @@ def generateCloverPinyins():
409390 newLine = line .replace (pinyin_old , maxPinyin )
410391 new_file .write (newLine )
411392 new_file .flush ()
412- > >> >> >> 6 b0f6ce91106b15c493322beb0bd93014502c988
413393 else :
414394 new_file .write (line )
415395 new_file .flush ()
@@ -493,16 +473,10 @@ def generateTerraPinyins():
493473 new_file .close ()
494474if __name__ == "__main__" :
495475 #generateNewBaseDict()
496- < << << << HEAD
497- pinyins = generatePinyins ("的话" )
498- print (pinyins )
499- #fixesBigDictErrors()
500- == == == =
501476 pinyins = generatePinyins ("小君" )
502477 print (pinyins )
503478 currPinyin = " " .join (pinyins [0 ])
504479 pinyin = pdb .formatMarkPinyin (currPinyin )
505480 print (pinyin )
506481 generateTerraBasePinyins ()
507482 #generateCloverPinyins()
508- >> >> >> > 6 b0f6ce91106b15c493322beb0bd93014502c988
0 commit comments