I used sogou pinyin before, but once my dictionary data was lost inexplicably, I found that my dictionary cannot be exported as plain text, so I gave up sogou's use of QQ pinyin. Yesterday I saw a cloud Input Method launched by sogou pinyin. It was really a very creative one. I decided to return to sogou pinyin because of sogou's creativity.
To return to the sogou Pinyin input method, the dictionary problem is very serious. By default, the QQ Pinyin input method cannot be imported into the sogou Pinyin input method, and the QQ Pinyin input method can be exported directly, the following prompt is displayed when importing the sogou Pinyin input method:
So I had to write a small program to convert the dictionary format of QQ Pinyin and then import it.
I analyzed the formats of the QQ pinyin dictionary and the sogou pinyin dictionary. The differences are as follows:
The QQ pinyin dictionary provides the number of word frequencies, but the sogou dictionary does not.
There are no single quotation marks before the Pinyin of QQ pinyin, but the sogou dictionary must be available.
Therefore, you only need to write a small piece of code to implement the above conversion. The Code is as follows: StreamReader sr = new StreamReader (this. textBox1.Text, Encoding. Default );
String newPath = Path. GetDirectoryName (textBox1.Text) + "\ Sougou PY.txt ";
StreamWriter sw = new StreamWriter (newPath, false, Encoding. Default );
While (sr. Peek ()> 0)
{
String str = sr. ReadLine ();
Var py = str. Split ('');
If (py. Count ()> 2)
{
String newPy = "'" + py [0] + "" + py [1];
Sw. WriteLine (newPy );
// RichTextBox1.AppendText (newPy + "\ r \ n ");
}
}
Sr. Close ();
Sw. Close ();
MessageBox. Show ("OK ");
In this way, you can convert the dictionary and save it as the Sougou PY.txt file.
Next, you can import the local text dictionary in the sogou input method. The imported results are as follows:
The code and program are attached to facilitate your use in the same situation (the executable file is in the bin/Debug directory.. net Framework 2.0 support. If it cannot run, install it. net):/Files/studyzy/QQPY2SGPY1.1.zip