def split_resource_url(resource_url):
 (protocol, path_) = resource_url.split(u':', 1)
 if (protocol == u'nltk'):
  pass
 elif (protocol == u'file'):
  if path_.startswith(u'/'):
   path_ = (u'/' + path_.lstrip(u'/'))
 else:
  path_ = re.sub(u'^/{0,2}', u'', path_)
 return (protocol, path_)

def split_resource_url ( resource_url ) : ( protocol , path_ ) = resource_url . split ( u':' , 1 ) if ( protocol == u'nltk' ) : pass elif ( protocol == u'file' ) : if path_ . startswith ( u'/' ) : path_ = ( u'/' + path_ . lstrip ( u'/' ) ) else : path_ = re . sub ( u'^/{0,2}' , u'' , path_ ) return ( protocol , path_ )
splits a resource url into "<protocol>:<path>" .