Example #1
0
 def parse_lines_AccentedTischendorf(self, lines):
     mystring = "\n".join(lines)
     words = mystring.split()
     self.end_monad += 1
     index = -1
     break_kind = "."
     for w in words:
         index += 1
         if w[0] in "0123456789":
             myarr = w.split(":")
             mychapter = int(myarr[0])
             try:
                 myverse = int(myarr[1])
             except:
                 print "UP100: w = '%s' words[index:+30] = '%s'" % (
                     w, words[index:index + 30])
             chapter_end = self.end_monad - 1
             if self.chapter != mychapter:
                 if self.chapter <> 0:
                     self.parseChapter(self.chapter, chapter_end)
                 self.chapter = mychapter
             self.verse = myverse
             verse = Verse([], self.bookname, self.booknumber)
             verse.chapter = mychapter
             verse.verse = myverse
             verse.first_monad = self.end_monad
             verse.last_monad = self.end_monad
             self.verses.append(verse)
         elif w == "{P}":
             break_kind = "P"
         elif w == "{C}":
             break_kind = "C"
         elif w == "-":
             pass  # Remove silently. FIXME: Do something more intelligent!
         else:
             wd = word.Word(self.end_monad, variant_none)
             wd.surface = w
             if "&" in wd.surface:
                 [wd.surface, wd.qere] = wd.surface.split("&")
             else:
                 wd.qere = wd.surface
             wd.qere_noaccents = word.RemoveAccents(
                 word.BETAtoOLBtranslate(wd.qere))
             #wd.parsing = "CONJ"
             #wd.Strongs1 = 9999
             wd.makeSurfacesAccentedTischendorf()
             wd.break_kind = break_kind
             break_kind = "."
             #print wd.surface, wd.accented_surface
             self.verses[-1].words.append(wd)
             self.verses[-1].last_monad = self.end_monad
             self.end_monad += 1
     self.parseChapter(self.chapter, chapter_end)
Example #2
0
 def parse_lines_AccentedTischendorf(self, lines):
     mystring = "\n".join(lines)
     words = mystring.split()
     self.end_monad += 1
     index = -1
     break_kind = "."
     for w in words:
         index += 1
         if w[0] in "0123456789":
             myarr = w.split(":")
             mychapter = int(myarr[0])
             try:
                 myverse = int(myarr[1])
             except:
                 print "UP100: w = '%s' words[index:+30] = '%s'" % (w, words[index:index+30])
             chapter_end = self.end_monad-1
             if self.chapter != mychapter:
                 if self.chapter <> 0:
                     self.parseChapter(self.chapter, chapter_end)
                 self.chapter = mychapter
             self.verse = myverse
             verse = Verse([], self.bookname, self.booknumber)
             verse.chapter = mychapter
             verse.verse = myverse
             verse.first_monad = self.end_monad
             verse.last_monad = self.end_monad
             self.verses.append(verse)
         elif w == "{P}":
             break_kind = "P"
         elif w == "{C}":
             break_kind = "C"
         elif w == "-":
             pass # Remove silently. FIXME: Do something more intelligent!
         else:
             wd = word.Word(self.end_monad, variant_none)
             wd.surface = w
             if "&" in wd.surface:
                 [wd.surface, wd.qere] = wd.surface.split("&")
             else:
                 wd.qere = wd.surface
             wd.qere_noaccents = word.RemoveAccents(word.BETAtoOLBtranslate(wd.qere))
             #wd.parsing = "CONJ"
             #wd.Strongs1 = 9999
             wd.makeSurfacesAccentedTischendorf()
             wd.break_kind = break_kind
             break_kind = "."
             #print wd.surface, wd.accented_surface
             self.verses[-1].words.append(wd)
             self.verses[-1].last_monad = self.end_monad
             self.end_monad += 1
     self.parseChapter(self.chapter, chapter_end)
Example #3
0
 def process_linear_verse(self, mychapterverse):
     myarr = mychapterverse[0:mychapterverse.find(".")].split(":")
     mychapter = int(myarr[0])
     myverse = int(myarr[1])
     chapter_end = self.end_monad
     self.end_monad += 1
     if self.chapter != mychapter:
         if self.chapter <> 0:
             self.parseChapter(self.chapter, chapter_end)
         self.chapter = mychapter
     if self.verse != myverse:
         self.verse = myverse
         verse = Verse([], self.bookname, self.booknumber)
         verse.chapter = mychapter
         verse.verse = myverse
         verse.first_monad = self.end_monad
         verse.last_monad = self.end_monad
         self.verses.append(verse)
Example #4
0
 def process_linear_verse(self, mychapterverse):
     myarr = mychapterverse[0:mychapterverse.find(".")].split(":")
     mychapter = int(myarr[0])
     myverse = int(myarr[1])
     chapter_end = self.end_monad
     self.end_monad += 1
     if self.chapter != mychapter:
         if self.chapter <> 0:
             self.parseChapter(self.chapter, chapter_end)
         self.chapter = mychapter
     if self.verse != myverse:
         self.verse = myverse
         verse = Verse([], self.bookname, self.booknumber)
         verse.chapter = mychapter
         verse.verse = myverse
         verse.first_monad = self.end_monad
         verse.last_monad = self.end_monad
         self.verses.append(verse)