goolabs/commands.py
def similarity(ctx, app_id, json_flag, query_pair, request_id):
    # type: (Context, unicode, bool, List[unicode], unicode) -> None
    """ Scoring the similarity of two words. """

    app_id = clean_app_id(app_id)

    api = GoolabsAPI(app_id)
    ret = api.similarity(
        query_pair=query_pair,
        request_id=request_id
    )

    if json_flag:
        click.echo(format_json(api.response.json()))
        return

    click.echo('{0:.16f}'.format(ret['score']))
def similarity(ctx, app_id, json_flag, query_pair, request_id):
    # type: (Context, unicode, bool, List[unicode], unicode) -> None
    app_id = clean_app_id(app_id)

    api = GoolabsAPI(app_id)
    ret = api.similarity(
        query_pair=query_pair,
        request_id=request_id
    )

    if json_flag:
        click.echo(format_json(api.response.json()))
        return

    click.echo('{0:.16f}'.format(ret['score']))
def similarity ( ctx , app_id , json_flag , query_pair , request_id ) : # type: (Context, unicode, bool, List[unicode], unicode) -> None app_id = clean_app_id ( app_id ) api = GoolabsAPI ( app_id ) ret = api . similarity ( query_pair = query_pair , request_id = request_id ) if json_flag : click . echo ( format_json ( api . response . json ( ) ) ) return click . echo ( '{0:.16f}' . format ( ret [ 'score' ] ) )
Scoring the similarity of two words.
Scoring the similarity of two words .