Skip to content

Add splitting of slash-separated titles - #75

Merged
codelucas merged 2 commits into
codelucas:masterfrom
igor-shevchenko:slash-splitter
Nov 25, 2014
Merged

Add splitting of slash-separated titles#75
codelucas merged 2 commits into
codelucas:masterfrom
igor-shevchenko:slash-splitter

Conversation

@igor-shevchenko

Copy link
Copy Markdown
Contributor

No description provided.

@codelucas

Copy link
Copy Markdown
Owner

Thanks for the PR, i'll look at it this weekend.

@igor-shevchenko

Copy link
Copy Markdown
Contributor Author

Hi Lucas.

It's been a long time since this pull request was made :)

Are there any problems with it? Maybe I should add some changes to keep up with current newspaper code?

@codelucas

Copy link
Copy Markdown
Owner

Hey Igor!

Thanks for the reminder.

Hmm, have you considered the case where you'd need to split the title by "/" versus " / " ?

I think it would be better if you'd change line:
https://github.com/igor-shevchenko/newspaper/blob/slash-splitter/newspaper/extractors.py#L187
and modify if ... " / " in ... to if ... "/" in ....

This is because if " / " won't catch titles split by a slash without spaces sandwiching it while "/" catches anything with a slash.

I'm just being nitty, but I want to know your thoughts.

@igor-shevchenko

Copy link
Copy Markdown
Contributor Author

Yeah, I think you're right.

All the examples I initially saw had that sandwiching, and I wanted to avoid splitting by slashes that are part of a title text, that's why I added that spaces. Now it seems to me that it should be a rare case, so it would be better to remove them. That way we can also split titles with double slashes (which sometimes occur).

So, thanks for the correction, I'll fix it.

@codelucas
codelucas merged commit 6f5a372 into codelucas:master Nov 25, 2014
@codelucas

Copy link
Copy Markdown
Owner

Nice work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants