public static RecipeIngredient parseRecipeLine(string input, IngredientContainer container)
        {
            // If input is empty, return null, or if the first character in the line
            // is not a '- character, it is considered error
            if (input.Length == 0 || input[0] != '-')
            {
                return(null);
            }

            // Regulat expression that looks for a single number, a fraction, or a number AND a fraction
            Regex  re     = new Regex(@"(\d+\/\d|\d+)");
            double amount = 0;

            foreach (Match match in re.Matches(input))
            {
                try
                {
                    amount += measurementConversion(match.ToString());
                }
                catch (Exception)
                {
                    Console.WriteLine("Could not process measurement amount");
                }
            }

            Ingredient currIngredient = findIngredient(input, container);

            if (currIngredient != null && amount != 0)
            {
                return(new RecipeIngredient(currIngredient, Convert.ToDecimal(amount)));
            }

            //Return null if there is error reading string
            return(null);
        }
        // Helper function to help identify ingredient given a recipe line
        public static Ingredient findIngredient(string input, IngredientContainer container)
        {
            Dictionary <string, Ingredient> .KeyCollection containerKeys = container.getContainerKeys();

            //Iterate through the key names and pinpoint an ingredient where the name
            foreach (string name in containerKeys)
            {
                if (input.Contains(name.Trim()))
                {
                    return(container.getIngredient(name));
                }
            }
            // if code reaches here, no valid ingredients found, return null
            return(null);
        }
        static void Main(string[] args)
        {
            /* Assumption: Input is organized in the following format, ingredients first, then recipes:
             *
             * "Ingredients" header
             *
             * Ingredient category (Either Product, Meat/poultry, and Pantry)
             *
             * Unit of ingredient = Corresponding Price
             * (e.g. - 1 clove of organic garlic = $0.67)
             *
             * "Recipe Headers"
             * List of ingredients for the recipe underneath
             * (e.g. - 3/4 cup olive oil)
             *
             * */

            //Holds the lines from the input.txt file
            string[] fileLines;

            try {
                fileLines = getInput();
            }
            catch (Exception)
            {
                Console.WriteLine("Can not find input.txt file, program will close now.");
                Console.ReadKey();
                return;
            }
            IngredientContainer ingredientContainer = new IngredientContainer();

            // Boolean flag signifying if the input has reached the recipe portion (the latter half)
            Boolean recipeSection = false;

            //Boolean flag representing on whether or not the beginning of a new recipe has started
            Boolean newRecipe = false;

            //Variable representing the current ingredient type being read in as input, initialize with 'other' placeholder
            IngredientType currentType = IngredientType.Other;

            // Recipe placeholder for the current recipe being populated
            Recipe currRecipe     = new Recipe();
            string currRecipeName = "";
            int    counter        = 0; //Counter variable to keep track of the amount of lines already iterated, used to check if the last line is currently being processed

            // Read each line read from the file
            foreach (string line in fileLines)
            {
                counter++;
                // Assumption, Ingredients first
                if (!recipeSection)
                {
                    if (line.Equals("Produce"))
                    {
                        currentType = IngredientType.Produce;
                        continue;
                    }
                    else if (line.Equals("Meat/poultry"))
                    {
                        currentType = IngredientType.Meat;
                        continue;
                    }
                    else if (line.Equals("Pantry"))
                    {
                        currentType = IngredientType.Pantry;
                        continue;
                    }

                    // Assumption: if the line starts with a '-' character, it is a valid ingredient description line

                    if (!currentType.Equals(IngredientType.Other) && line.Length > 0 && line[0] == '-')
                    {
                        //Console.WriteLine("\n" + line);

                        //Add valid ingredients into the IngredientContainer
                        Ingredient newIngredient = ParseHandler.parseIngredientLine(line, currentType);
                        if (newIngredient != null)
                        {
                            ingredientContainer.addIngredient(newIngredient);
                        }
                    }
                    //Recipe section has been reached, start processing recipes
                    if (line.Length > 0 && line.Split()[0].Equals("Recipe"))
                    {
                        recipeSection  = true;
                        newRecipe      = true;
                        currRecipeName = line.Trim();
                    }
                }
                else
                {   // Start processing recipes
                    if (newRecipe)
                    {
                        currRecipe = new Recipe(currRecipeName);
                        newRecipe  = false;
                    }
                    // New recipe detected, start a new recipe
                    if (line.Length > 0 && line.Split()[0].Equals("Recipe"))
                    {
                        //Console.WriteLine("\n New recipe: " + line);
                        recipeSection  = true;
                        newRecipe      = true;
                        currRecipeName = line.Trim();

                        // Print recipe stats here
                        currRecipe.calculateStats();
                    }
                    RecipeIngredient currRecipeIngredient = ParseHandler.parseRecipeLine(line, ingredientContainer);

                    if (currRecipeIngredient != null)
                    {
                        //Console.WriteLine("adding " + currRecipeIngredient.getIngredient().getName());
                        currRecipe.addRecipeIngredient(currRecipeIngredient);
                    }
                    //If it's the last line processed, then it's the last line for the last recipe as well, so print recipe's cost statistics
                    if (counter == (fileLines.Length))
                    {
                        currRecipe.calculateStats();
                    }
                }
            }
            Console.ReadKey();
        }