Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(20)  |  Call(16)  |  Derive(0)  |  Import(4)

        def join_uri(*pieces):
    """
    `join_uri` builds a URI from constituent pieces that should be joined
    with slashes (/).

    Leading and trailing on the pieces are acceptable, but will be ignored.
    The resulting URI will always begin with a slash and have its pieces
    separated by a single slash.

    The pieces do not have `normalize_text` applied to them; to make sure your
    URIs are in normal form, run `normalize_text` on each piece that represents
    arbitrary text.

    >>> join_uri('/c', 'en', 'cat')
    '/c/en/cat'

    >>> join_uri('c', 'en', ' spaces ')
    '/c/en/ spaces '

    >>> join_uri('/r/', 'AtLocation/')
    '/r/AtLocation'

    >>> join_uri('/test')
    '/test'

    >>> join_uri('test')
    '/test'
    
    >>> join_uri('/test', '/more/')
    '/test/more'
    """
    joined = '/' + ('/'.join([piece.strip('/') for piece in pieces]))
    return joined
        


src/c/o/ConceptNet-5.2.2/conceptnet5/readers/conceptnet4.py   ConceptNet(Download)
from conceptnet5.nodes import normalized_concept_uri
from conceptnet5.edges import make_edge
from conceptnet5.uri import join_uri, Licenses, normalize_text, BAD_NAMES_FOR_THINGS
 
# bedume is a prolific OMCS contributor who seemed to go off the rails at some
 
    if polarity > 0:
        relation = join_uri('/r', relname)
    else:
        relation = join_uri('/r', 'Not' + relname)
def build_data_set(parts_dict):
    lang = parts_dict['lang']
    dataset = join_uri('/d/conceptnet/4', lang)
    return dataset
 
    activity = parts_dict["activity"]
 
    creator_node = join_uri('/s/contributor/omcs', parts_dict["creator"])
    activity_node = join_uri('/s/activity/omcs', normalize_text(activity))
    if preposition_fix:

src/c/o/conceptnet5-HEAD/conceptnet5/readers/conceptnet4.py   conceptnet5(Download)
from conceptnet5.nodes import normalized_concept_uri
from conceptnet5.edges import make_edge
from conceptnet5.uri import join_uri, Licenses, normalize_text, BAD_NAMES_FOR_THINGS
 
# bedume is a prolific OMCS contributor who seemed to go off the rails at some
 
    if polarity > 0:
        relation = join_uri('/r', relname)
    else:
        relation = join_uri('/r', 'Not' + relname)
def build_data_set(parts_dict):
    lang = parts_dict['lang']
    dataset = join_uri('/d/conceptnet/4', lang)
    return dataset
 
    activity = parts_dict["activity"]
 
    creator_node = join_uri('/s/contributor/omcs', parts_dict["creator"])
    activity_node = join_uri('/s/activity/omcs', normalize_text(activity))
    if preposition_fix:

src/c/o/ConceptNet-5.2.2/conceptnet5/readers/wordnet.py   ConceptNet(Download)
from __future__ import unicode_literals
from collections import defaultdict
from conceptnet5.uri import join_uri
from conceptnet5.nodes import normalized_concept_uri
from conceptnet5.edges import make_edge
                        web_rel = web_rel.replace('meronym', 'holonym')
                        mapped_rel = mapped_rel[1:]
                    rel = join_uri('r', mapped_rel)
                else:
                    rel = join_uri('r', 'wordnet', pred_label)

src/c/o/conceptnet5-HEAD/conceptnet5/readers/wordnet.py   conceptnet5(Download)
from __future__ import unicode_literals
from collections import defaultdict
from conceptnet5.uri import join_uri
from conceptnet5.nodes import normalized_concept_uri
from conceptnet5.edges import make_edge
                        web_rel = web_rel.replace('meronym', 'holonym')
                        mapped_rel = mapped_rel[1:]
                    rel = join_uri('r', mapped_rel)
                else:
                    rel = join_uri('r', 'wordnet', pred_label)