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

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def sounds_like_score(target, clue):
    """
    A measure of the similarity between a target word and a 'clue' for that word.
    If the clue as a whole "sounds like" the target word, or each word within it
    does, it is likely that the clue is a pun-based clue, not a meaning-based
    clue.

    >>> sounds_like_score('heat', 'feat meat')
    0.5625
    >>> sounds_like_score('fish', 'chips')
    0.08333333333333333
    """
    subscores = []
    for word in clue.split():
        subscores.append(_sounds_like_score(target, word))
    scores = [_sounds_like_score(target, clue),
              sum(subscores) / len(subscores)]
    return max(scores)
        


src/c/o/conceptnet5-HEAD/conceptnet5/readers/verbosity.py   conceptnet5(Download)
from conceptnet5.edges import make_edge
from conceptnet5.formats.json_stream import JSONStreamWriter
from conceptnet5.util.sounds_like import sounds_like_score
from collections import defaultdict
import re
        # pun or rhyme, rather than an actual common-sense relationship. If
        # the sounds-like score is over 0.35, skip the assertion.
        sls = sounds_like_score(left, right)
        if sls > 0.35:
            outcomes['text similarity'] += 1

src/c/o/ConceptNet-5.2.2/conceptnet5/readers/verbosity.py   ConceptNet(Download)
from conceptnet5.edges import make_edge
from conceptnet5.formats.json_stream import JSONStreamWriter
from conceptnet5.util.sounds_like import sounds_like_score
from collections import defaultdict
import re
        # pun or rhyme, rather than an actual common-sense relationship. If
        # the sounds-like score is over 0.35, skip the assertion.
        sls = sounds_like_score(left, right)
        if sls > 0.35:
            outcomes['text similarity'] += 1