equal
deleted
inserted
replaced
188 Note that spaces are normalized. |
188 Note that spaces are normalized. |
189 """ |
189 """ |
190 if text is None: |
190 if text is None: |
191 return u'' |
191 return u'' |
192 words = text.split() |
192 words = text.split() |
193 text = ' '.join(words) # normalize spaces |
193 text = u' '.join(words) # normalize spaces |
194 minlength = len(' '.join(words[:nbwords])) |
194 minlength = len(' '.join(words[:nbwords])) |
195 textlength = text.find('.', minlength) + 1 |
195 textlength = text.find('.', minlength) + 1 |
196 if textlength == 0: # no point found |
196 if textlength == 0: # no point found |
197 textlength = minlength |
197 textlength = minlength |
198 return text[:textlength] |
198 return text[:textlength] |