Paip. Importing data into the English voice database MySQL road to solve the empty principle problem
#---Reason: MySQL import tool bug
#---Resolution: Do not use double quotes around phonetic notation.
The author old Java Claw Attilax Ayron. Email:[email protected]
Reprint please indicate source: 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 ("Ah? b?
' Rei?
? n ")
Filehandle.close ()
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Paip. Importing data into the English voice database MySQL road to solve the empty principle problem