public void ApplyRule(string ruleId, List <string> words) { var existing = GetRuleById(ruleId); if (existing == null) { Console.WriteLine("This rule does not exist!"); return; } if (existing.RuleStatus == RuleStatus.Stopped) { Console.WriteLine("This rule has been stopped!"); return; } var result = existing.Count(words); var name = existing.GetRuleName(); _ioService.OutputResult(name, result.ToString()); Console.WriteLine("This rule has been applied successfully!"); }