Beispiel #1
0
        /// <summary>
        /// Load the configuration from the file
        /// </summary>
        public void LoadFromFile()
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      f;

            if (System.IO.File.Exists(config_path))
            {
                f = File.Open(config_path, FileMode.Open);
                try
                {
                    LSIConfiguration lsic = (LSIConfiguration)bf.Deserialize(f);
                    this.document_directory        = lsic.document_directory;
                    this.k_percent_for_rank_approx = lsic.k_percent_for_rank_approx;
                }
                catch
                {
                    f.Close();
                    f = null;
                    this.SetDefault();
                    this.SaveToFile();
                }
                if (f != null)
                {
                    f.Close();
                }
            }
            else
            {
                this.SetDefault();
                this.SaveToFile();
            }
        }
Beispiel #2
0
 // List of initializations.
 public void Init()
 {
     StopWordsList.InitializeList(this.LSIAppPath + @"\StopList\StopList.txt");
     _lsiConfig = new LSIConfiguration();
 }