Extract first sentence
(s)
| 12 | |
| 13 | |
| 14 | def sentencize(s): |
| 15 | """Extract first sentence |
| 16 | """ |
| 17 | s = s.replace('\n', ' ').strip().split('.') |
| 18 | s = s[0] if len(s) else s |
| 19 | try: |
| 20 | return " ".join(s.split()) |
| 21 | except AttributeError: |
| 22 | return s |
| 23 | |
| 24 | |
| 25 | def most_common(lst, n=3): |