小程序:将supermemo palm词库转化成的tab txt 文件转化为 Q&A 文件
准备用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


浙公网安备 33010602011771号