paip.将数据导入到在英语语音数据库mysql道路解决空原则问题
#---原因:mysql 导入工具bug
#---解决:不要使用双引号括注音.
笔者 老哇爪 Attilax 艾龙。 EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
from log import *
iniLog (r"c:\enWzPhonetic.log")
n=0
for line in lines:
if(n>100000 ):break;
if( not isContain(line, "[")):continue;
word= left_ByFirstChar(line, r"[")
word=trim(word)
logging.info(" start to word:"+word)
phonetic=subStrNtrim(line, r"[", r"]")
phonetic=replace_multiple(phonetic,splitor, spltrFinal )
phonetic=trim_multi(phonetic, "@ ")
logging.info(word+"---\""+phonetic+"\"")
#todox import mysql5.6 empty, in phntc ,so .must include use doubleQuot
line=word+"\t\""+phonetic+"\""
fileHandle.write(line+"\n")
n=n+1
#endfor
print ("啊?b?
'rei?
?n")
fileHandle.close()
版权声明:本文博主原创文章,博客,未经同意不得转载。