public OptionsForm( Engine engine, Options options, Categories categories ) { _engine = engine; _categories = categories; _options = options; InitializeComponent(); }
public Categories( Engine engine ) { // the engine. _engine = engine; // (re)load the categories ReloadCategories(); }
public CustomUI(Engine engine, Categories categories, Options options ) { // the engine. _engine = engine; // the categories. _categories = categories; // the options _options = options; }
public CategoryForm( Engine engine, Category category ) { // InitializeComponent(); // the engine to create new categories. _engine = engine; // the category we working with. GivenCategory = category; }
public MagnetMailItemForm( Engine engine, Outlook._MailItem mailItem, Categories categories ) { // InitializeComponent(); // the engine to create new categories. _engine = engine; // the categories _categories = categories; // the mail item _mailItem = mailItem; }
public MagnetForm( Engine engine, Categories categories, Magnet magnet ) { // InitializeComponent(); // the engine to create new categories. _engine = engine; // the category we working with. GivenMagnet = magnet; // the categories _Categories = categories; }
public DetailsForm(Engine classifyEngine, string rawText ) { // the classifier engine _classifyEngine = classifyEngine; // the raw text _rawText = rawText; // we can now init everything. InitializeComponent(); // maximized the window. WindowState = FormWindowState.Maximized; }
protected static Engine CreateEngine() { // the paths we will be using. DirectoryPath = GetDirectory(); if (null == DirectoryPath) { throw new Exception("I could not find the current working path."); } // the database path DatabaseFullPath = $"{DirectoryPath}\\{DbName}"; // if the file exists, then we need to remove it. if (File.Exists(DatabaseFullPath)) { // just in case it does exist. File.Delete(DatabaseFullPath); if (File.Exists(DatabaseFullPath)) { Assert.Fail("Could not remove the old db from previous tests."); } } CleanDatabaseFullPath = $"{DirectoryPath}\\{CleandbName}"; if (!File.Exists(CleanDatabaseFullPath)) { var e = new Engine(DirectoryPath, CleanDatabaseFullPath); e.SetConfig("Option.CommonWordsMinPercent", "100"); e.Release(); } // make sure that we have a clean database. File.Copy(CleanDatabaseFullPath, DatabaseFullPath); if (!File.Exists(DatabaseFullPath)) { Assert.Fail( "Could not create the new db from the clean db." ); } //create the engine return new Engine(DirectoryPath, DatabaseFullPath); }
protected static void ReleaseEngine( bool removeCleanDb ) { // don't do it more than once... if (null != _engine) { // release the engine _engine.Release(); // free the memory, (but the gc might not do it right away). _engine = null; } // try and remove the database. try { File.Delete(DatabaseFullPath); } catch (Exception) { // ignore the Exception ... // the file will be deleted later. } try { // if the file exists, then we need to remove it. if (removeCleanDb == true && File.Exists(CleanDatabaseFullPath)) { // just in case it does exist. File.Delete(CleanDatabaseFullPath); } } catch (Exception) { // ignore the Exception ... // the file will be deleted later. } }
public CategoriesForm( Categories categories, Engine engine) { _engine = engine; _categories = categories; InitializeComponent(); }
public Options(Engine engine) { _engine = engine; }