The code for combining Kingsoft wordlist
Author
Zhou Renjian
Create@
2004-07-10 10:21
<script type="text/javascript">
var files = new Array(
"WordList_4.txt",
"WordList_6.txt",
"WordList_CR.txt",
"WordList_FYB.txt",
"WordList_FYBZ.txt",
"WordList_FYZ.txt",
"WordList_GRE.txt",
"WordList_GZ.txt",
"WordList_MBA.txt",
"WordList_TOFEL.txt",
"WordList_YJ.txt"
);
var absolutePath = "Q:\\Eclipse3.0\\wordlist\\";
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var wordList = new Array();
for (var i = 0; i < files.length; i ++) {
var txt = FSO.OpenTextFile(absolutePath + files[i], 1, false);
txt.skipLine();
txt.skipLine();
while (!txt.AtEndOfStream)
wordList[wordList.length] = txt.ReadLine();
txt.Close();
}
alert(wordList.length);
// remove the duplicated word
wordList = wordList.sort();
//var combinedWordList = new Array();
var prevWord = "";
var combinedFileName = "WordList_ALL.txt";
var txtOut = FSO.CreateTextFile(absolutePath + combinedFileName, true);
for (var i = 0; i < wordList.length; i ++) {
if (prevWord != wordList[i]) {
prevWord = wordList[i];
txtOut.writeLine(wordList[i]);
//combinedWordList[combinedWordList.length] = wordList[i];
}
}
txtOut.close();
//alert(combinedWordList.length);
</script>