code: def segments(self, text):
          
          start = 0
          for (L, P, R, B, end) in Detector.candidates(text):
              # if there's already a newline there, we have nothing to do
              if B:
                  continue
              if self.predict(L, P, R):
                  yield text[start:end].rstrip()
                  start = end
              # otherwise, there's probably not a sentence boundary here
          yield text[start:].rstrip()
docs: Given a string of `text`, return a generator yielding each
          hypothesized sentence string