Used for dictionary index file creation
For a list of all members of this type, see DictImport Members.
System.Object
dict.DictImport
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Use this class in order to create a dictionary index file for one of the following dictionary types:
the
or of
may easyly have several thousands explanations. In order to limit the amount of translations to a human acceptable level, the class accepts max. MAXENTRIES (150) explanations for one keyword, the remaining explanations are slightly ignored. See also the description of the class ParserBase for more details of the expected format of the dictionary file and the description of the method DictImport.saveIdx() for more details on the format of the dictionary index file created here. The index files created in DictImport.saveIdx() may be used for instantiating the dictionary index objects DictIndex used for querying the dictionary.
The following example creates a dictionary index file from a dictionary file obtained from dict.cc: c:\temp\engdeu.idx
from a dictionary file c:\temp\engdeu.txt
obtained from dict.cc:
[C#]
using dict;
using System;
public class Import : IProgress {
public void progress(int perc) {
Console.WriteLine("Imported {0} percents", perc);
}
public void ready(string message) {
if (message != null) Console.WriteLine(message);
Console.WriteLine("Ready, press ENTER to exit");
}
public Import(string dictfile, string idxfile, DictType type) {
DictImport imp;
imp = new DictImport(this, dictfile, idxfile, type);
imp.start();
Console.WriteLine("Wait until ready or press ENTER to break");
Console.ReadLine();
imp.stop();
if (imp.lastexcp != null) Console.Writeline(imp.lastexcp);
}
public static void Main() {
new Import(@"c:\temp\engdeu.txt", @"c:\temp\engdeu.idx", DictType.DICTCC);
}
}
Namespace: dict
Assembly: dict (in dict.exe)
DictImport Members | dict Namespace | DictParser | DictIndex