Exemple #1
0
 def parse_frankenstein(self, line, scene):
     bad_string = "Free eBooks at Planet eBook.com "
     page_regex = '([0-9]{1,3}$)'
     chapter_regex = "(Chapter \d)"
     line = line.strip('\n') + ' '
     if line != bad_string and not match(page_regex, line) and not match(
             chapter_regex, line) and line != "Frankenstein ":
         scene.concat_sentences(line)
Exemple #2
0
    def create_scenes(self):
        scene = MovieScene()

        for line in read_file(self.path):
            if match(self.regex, line):
                self.sc.add(scene)
                scene = MovieScene()

            scene.add_line(line)
            self.size += len(line)
Exemple #3
0
 def parse_wizard(self, line, scene):
     chapter_regex = "([0-9]*\. *)"
     line = line.strip('\n') + ' '
     if not match(chapter_regex, line):
         scene.concat_sentences(line)
Exemple #4
0
 def parse_ripley(self, line, scene):
     chapter_regex = "(Chapter *)"
     line = line.strip() + ' '
     if not match(chapter_regex, line):
         scene.concat_sentences(line)
Exemple #5
0
 def parse_shining(self, line, scene):
     chapter_regex = "(<< [0-9]* >>)"
     line = line.strip('\n') + ' '
     if not match(chapter_regex, line) and not line.isupper():
         scene.concat_sentences(line)
Exemple #6
0
 def parse_bourne(self, line, scene):
     chapter_regex = "(([0-9]|[0-9][0-9])$)"
     line = line.strip('\n') + ' '
     if not match(chapter_regex, line) and line != '':
         scene.concat_sentences(line)
Exemple #7
0
 def parse_schindlers(self, line, scene):
     chapter_regex = "((PROLOGUE|CHAPTER|EPILOGUE).*)"
     line = line.strip('\n') + ' '
     if not match(chapter_regex, line):
         scene.concat_sentences(line)