Exemple #1
0
    def previous_introductory_section(self):
        read_out = ReadOut()

        segment = "introduction"
        attr = "sections"
        NextSection, PreviousSection = self.get_introductory_section()
        self.params["introductorySection"] = PreviousSection
        if not PreviousSection:
            raise (OperationsException("There are no sections before this."))

        response = "The previous section is " + "<break time='0.5s' />"
        response += read_out.read_section(segment, "", attr, PreviousSection)
        return response
Exemple #2
0
    def next_introductory_section(self):
        read_out = ReadOut()

        segment = "introduction"
        NextSection, PreviousSection = self.get_introductory_section()
        attr = "sections"

        if not NextSection:
            raise (OperationsException("There are no sections after this."))
        self.params["introductorySection"] = NextSection

        response = "The next section is " + "<break time='0.5s' />"
        response += read_out.read_section(segment, "", attr, NextSection)
        return response
Exemple #3
0
    def previous_lesson_section(self):
        read_out = ReadOut()

        segment = "lessons"
        lesson = "What's the weather like"
        NextSection, PreviousSection = self.get_lesson_section()
        if not PreviousSection:
            raise (OperationsException("There are no sections before this."))
        self.params["lesson_section"] = PreviousSection
        attr = "sections"

        response = "The previous section is " + "<break time='0.5s' />"
        response += read_out.read_section(segment, lesson, attr,
                                          PreviousSection)
        return response
Exemple #4
0
 def read_lesson_additional_section(self):
     read_out = ReadOut()
     """
     As of now we have only one lesson
     """
     segment = "lessons"
     lesson = "What's the Weather Like"
     attr = "additional_sections"
     section = self.params["lesson_additional_section"]
     # response = fetch_ordinal_of_section( "lessons",section, "additional_sections")
     response = read_out.read_section(segment, lesson, attr, section,
                                      self.params["query"])
     self.context = self.context_manager.set_context_for_read_out(
         self.params, response)
     return response, self.context
Exemple #5
0
    def next_lesson_additional_section(self):
        """
        As of now we have only one lesson
        """
        read_out = ReadOut()

        segment = "lessons"
        lesson = "What's the weather like"
        attr = "additional_sections"
        NextSection, PreviousSection = self.get_lesson_additional_section()

        if not NextSection:
            raise (OperationsException("There are no sections after this."))
        self.params["lesson_additional_section"] = NextSection
        response = "The next section is " + "<break time='0.5s' />"
        response += read_out.read_section(segment, lesson, attr, NextSection)
        return response
Exemple #6
0
 def read_segment_section(self):
     read_out = ReadOut()
     """
     As of now dealing with only introduction segment,
     TO-DO need to get segment name for a given section name 
         if other segments also implemented
     """
     segment = "introduction"  # self.params["segment"].lower()
     section = self.params["introductorySection"]
     """
     attr :: lesson segment have sections & additional sections attibute
             other segments only have sections attribute
     """
     attr = "sections"
     #         self.params["segment"] = segment
     # response = fetch_ordinal_of_section("introduction",section, "sections")
     response = read_out.read_section(
         segment, "", attr, section,
         self.params["query"])  # self.params #Parameters(**self.params)
     self.context = self.context_manager.set_context_for_read_out(
         self.params, response)
     return response, self.context