public void TestEnglish() { var name = "DB.english"; var sourcename = "dbs/strings/dictionaries/English.dic"; MetricDB original = null; if (!File.Exists (name)) { Console.WriteLine ("compiling the database '{0}' -> '{1}'", sourcename, name); var db0 = new StringLevenshteinSpace<char>(); // we need to read sequences manually since we are not reading sequences of numbers db0.StringParser = (string s) => s.ToCharArray(); db0.Build (sourcename); SpaceGenericIO.Save (name, db0, false); original = db0; } Console.WriteLine ("loading compiled version of the database '{0}'", name); var db1 = (StringLevenshteinSpace<char>)SpaceGenericIO.Load (name); if (original != null) { this.AssertEqualityDB (original, db1); } db1.StringParser = (string s) => s.ToCharArray(); this.Test(name, db1, "queries-english-256", 300, 32, 512); }
public static void MainSTRED(IndexArgumentSetup setup) { var basename = Path.GetFileName (setup.DATABASE); var nick = String.Format("{0}{1}", setup.PREFIX, basename); if (!Directory.Exists (nick)) { Directory.CreateDirectory (nick); } ExecuteMain (nick, setup, () => { if (!File.Exists(setup.BINARY_DATABASE)) { var sp = new StringLevenshteinSpace(); sp.Build(setup.DATABASE); SpaceGenericIO.Save(setup.BINARY_DATABASE, sp); } }); }