Skip to content

Commit

Permalink
fixed more doctests in split_resource_url()
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Xu committed Feb 7, 2014
1 parent 02df29e commit 78c1311
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nltk/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ def split_resource_url(resource_url):
Splits a resource url into "<protocol>:<path>".
>>> windows = sys.platform.startswith('win')
>>> windows or split_resource_url('file:///home/nltk') == ('file', '/home/nltk')
True
>>> not windows or split_resource_url('file:///C:/home/nltk') == ('file', '/C:/home/nltk')
True
>>> split_resource_url('nltk:home/nltk')
('nltk', 'home/nltk')
>>> split_resource_url('nltk:/home/nltk')
('nltk', '/home/nltk')
>>> split_resource_url('file:/home/nltk')
('file', '/home/nltk')
>>> split_resource_url('file:///home/nltk')
('file', '/home/nltk')
>>> split_resource_url('file:///C:/home/nltk')
('file', '/C:/home/nltk')
"""
protocol, path_ = resource_url.split(':', 1)
if protocol == 'nltk':
Expand Down

0 comments on commit 78c1311

Please sign in to comment.