public void LoadTrainingData(IDBLoader loader) { this.trainingData = new Dictionary<Guid, IRecipeClassification>(); this.breakfastIndex = new RecipeIndex(); this.lunchIndex = new RecipeIndex(); this.dinnerIndex = new RecipeIndex(); this.dessertIndex = new RecipeIndex(); var data = loader.LoadTrainingData(); foreach (var recipe in data) { this.trainingData.Add(recipe.Recipe.Id, recipe); if (recipe.IsBreakfast) { this.breakfastIndex.Add(recipe.Recipe); } if (recipe.IsLunch) { this.lunchIndex.Add(recipe.Recipe); } if (recipe.IsDinner) { this.dinnerIndex.Add(recipe.Recipe); } if (recipe.IsDessert) { this.dessertIndex.Add(recipe.Recipe); } } }
private void LoadTrainingData(IDBLoader loader) { this.trainingData = new Dictionary <Guid, IRecipeClassification>(); this.breakfastIndex = new RecipeIndex(); this.lunchIndex = new RecipeIndex(); this.dinnerIndex = new RecipeIndex(); this.dessertIndex = new RecipeIndex(); var data = loader.LoadTrainingData(); foreach (var recipeClassification in data) { this.trainingData.Add(recipeClassification.Recipe.Id, recipeClassification); if (recipeClassification.IsBreakfast) { this.breakfastIndex.Add(recipeClassification.Recipe); } if (recipeClassification.IsLunch) { this.lunchIndex.Add(recipeClassification.Recipe); } if (recipeClassification.IsDinner) { this.dinnerIndex.Add(recipeClassification.Recipe); } if (recipeClassification.IsDessert) { this.dessertIndex.Add(recipeClassification.Recipe); } } }
public void LoadTrainingData(IDBLoader loader) { trainingData = new Dictionary <Guid, IRecipeClassification>(); BreakfastIndex = new RecipeIndex(); LunchIndex = new RecipeIndex(); DinnerIndex = new RecipeIndex(); DessertIndex = new RecipeIndex(); var data = loader.LoadTrainingData(); foreach (var recipe in data) { trainingData.Add(recipe.Recipe.Id, recipe); if (recipe.IsBreakfast) { BreakfastIndex.Add(recipe.Recipe); } if (recipe.IsLunch) { LunchIndex.Add(recipe.Recipe); } if (recipe.IsDinner) { DinnerIndex.Add(recipe.Recipe); } if (recipe.IsDessert) { DessertIndex.Add(recipe.Recipe); } } }