String space
상속: StringSpace
예제 #1
0
파일: Main.cs 프로젝트: vfaby/natix
 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);
 }
예제 #2
0
파일: Program.cs 프로젝트: sadit/natix
        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);
                }
            });
        }