Ejemplo n.º 1
0
 public static String MakeCourseNameForSpeech(SemanticValueDict semantics)
 {
     if (semantics.ContainsKey(Slots.Department.ToString()) && semantics.ContainsKey(Slots.Number.ToString()))
      {
     String dept = String.Join(" ", semantics.GetSlot(Slots.Department).ToCharArray());
     String number = semantics.GetSlot(Slots.Number);
     return dept + " " + number;
      }
      else
      {
     return "this";
      }
 }
Ejemplo n.º 2
0
        public static List<Slots> ContainsScheduledCourseData(SemanticValueDict course, bool ignoreSemester = false)
        {
            List<Slots> missing = ContainsCourseData(course);
             if (!ignoreSemester)
             {
            if (!course.ContainsKey(Slots.Semester.ToString()) && !DialogManager.Instance.CurrentSemester.HasValue)
            {
               missing.Add(Slots.Semester);
            }
            if (!course.ContainsKey(Slots.Year.ToString()) && !DialogManager.Instance.CurrentYear.HasValue)
            {
               missing.Add(Slots.Year);
            }
             }

             return missing;
        }
Ejemplo n.º 3
0
        public static Semester? GetSemester(SemanticValueDict semantics, Semester? sem = null)
        {
            if (semantics.ContainsKey(Slots.Semester.ToString()))
             {
            sem = (Semester)Enum.Parse(typeof(Semester), semantics[Slots.Semester.ToString()].Value.ToString(), true);
             }

             return sem;
        }
Ejemplo n.º 4
0
 public static List<Slots> SemanticsContainsCourseData(SemanticValueDict course)
 {
     List<Slots> missing = new List<Slots>();
      if (!course.HasSlot(Slots.CourseName))
      {
     if (!course.ContainsKey(Slots.Department.ToString()))
     {
        missing.Add(Slots.Department);
     }
     if (!course.ContainsKey(Slots.Number.ToString()))
     {
        missing.Add(Slots.Number);
     }
      }
      return missing;
 }
Ejemplo n.º 5
0
        public static int? GetYear(SemanticValueDict semantics, int? year = null)
        {
            if (semantics.ContainsKey(Slots.Year.ToString()))
            year = int.Parse(semantics[Slots.Year.ToString()].Value.ToString());

             return year;
        }