準備用supermemo2006 背單詞,下載了palm版的詞庫,不可以用,寫了這個東西。
很簡單,沒有什麼東東,剛寫c#,也沒有經驗,至於將palm的pdb檔案直接轉化為Q&A檔案,還是等下次有時間弄清楚了pdb檔案結構再說吧,切記是 Encoding.unicode,否則會出現亂碼,至於import Q&A檔案時,沒有什麼要改的
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace palm2pc
{
class Program
{
static void Main(string[] args)
{
try
{
StreamReader sr = new StreamReader(@"H:\sm\volca\Collins分級詞彙(第1-5級)英漢版4Supermemo\CollinsL5YHOK.txt", Encoding.Default);
StreamWriter sw = new StreamWriter(@"H:\sm\volca\Collins分級詞彙(第1-5級)英漢版4Supermemo\CollinsL5YHOK4PC.txt",false,Encoding.Unicode);
string sline=sr.ReadLine();
string[] chang ;
string q ="Q: ";
string a ="A: ";
while (sline != null)
{
chang = sline.Split('\t');
sw.Write(q);
sw.Write(chang[0]);
sw.WriteLine();
sw.Write(a);
sw.Write(chang[1]);
sw.WriteLine();
sline = sr.ReadLine();
}
sr.Close();
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
轉化後的詞庫檔案放在各大資料共用中,如iask