Exemplo n.º 1
0
def sinkSnippetEmbedder(projectRoot, sinkOfInterest, configuration):

    print "embed for sink: %s" % sinkOfInterest
    sink = SinkUserProvider(projectRoot).getSinkByName(sinkOfInterest)
    sinkUserEmbedder = SinkSnippetEmbedder(projectRoot, configuration["ngramN"], configuration["smallerNgramsToo"])
    (name, termDocMatrix) = sinkUserEmbedder.embedSinkUsers(sink)  # @UnusedVariable
    return termDocMatrix
Exemplo n.º 2
0
def embedFunctionsUsingSink(projectRoot, filterName, ngramN, smallerNgramsToo, sinkOfInterest):
    from tools.SinkSnippetEmbedder.SinkSnippetEmbedder import SinkSnippetEmbedder
    from tools.SinkSnippetEmbedder.SinkUserProvider import SinkUserProvider
    
    name = '%s_%d.pickl' % (filterName, ngramN)
    embedder = SinkSnippetEmbedder(projectRoot, ngramN, smallerNgramsToo)
    sink = SinkUserProvider(projectRoot).getSinkByName(sinkOfInterest)
    
    embedder.embedSinkUsers(sink)
    return embedder.save(name, sinkOfInterest)
Exemplo n.º 3
0
def sinkSnippetEmbedder(projectRoot, sinkOfInterest, configuration):

    print 'embed for sink: %s' % sinkOfInterest
    sink = SinkUserProvider(projectRoot).getSinkByName(sinkOfInterest)
    sinkUserEmbedder = SinkSnippetEmbedder(projectRoot,
                                           configuration['ngramN'],
                                           configuration['smallerNgramsToo'])
    (name,
     termDocMatrix) = sinkUserEmbedder.embedSinkUsers(sink)  #@UnusedVariable
    return termDocMatrix
Exemplo n.º 4
0
def embedFunctionsUsingSink(projectRoot, filterName, ngramN, smallerNgramsToo,
                            sinkOfInterest):
    from tools.SinkSnippetEmbedder.SinkSnippetEmbedder import SinkSnippetEmbedder
    from tools.SinkSnippetEmbedder.SinkUserProvider import SinkUserProvider

    name = '%s_%d.pickl' % (filterName, ngramN)
    embedder = SinkSnippetEmbedder(projectRoot, ngramN, smallerNgramsToo)
    sink = SinkUserProvider(projectRoot).getSinkByName(sinkOfInterest)

    embedder.embedSinkUsers(sink)
    return embedder.save(name, sinkOfInterest)