paip.导入数据英文音标到数据库mysql为空的问题之道解决原理
时间:2014-04-28 10:45:40
收藏:0
阅读:420
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()
#---原因: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()
评论(0)