Split the title to best part possible
(self, title, splitter)
| 267 | return title |
| 268 | |
| 269 | def split_title(self, title, splitter): |
| 270 | """Split the title to best part possible |
| 271 | """ |
| 272 | large_text_length = 0 |
| 273 | large_text_index = 0 |
| 274 | title_pieces = splitter.split(title) |
| 275 | |
| 276 | # find the largest title piece |
| 277 | for i in range(len(title_pieces)): |
| 278 | current = title_pieces[i] |
| 279 | if len(current) > large_text_length: |
| 280 | large_text_length = len(current) |
| 281 | large_text_index = i |
| 282 | |
| 283 | # replace content |
| 284 | title = title_pieces[large_text_index] |
| 285 | return TITLE_REPLACEMENTS.replaceAll(title).strip() |
| 286 | |
| 287 | def get_feed_urls(self, source_url, categories): |
| 288 | """Takes a source url and a list of category objects and returns |
no test coverage detected