How to use the keyvi.CompletionDictionaryMerger function in keyvi

To help you get started, we’ve selected a few keyvi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KeyviDev / keyvi / python / src / py / keyvi / cli / cli.py View on Github external
def merge(args):
    params = {key: value for key, value in args.merger_params}

    dict_type = args.dict_type
    if dict_type == 'json':
        merger = keyvi.JsonDictionaryMerger(params)
    elif dict_type == 'string':
        merger = keyvi.StringDictionaryMerger(params)
    elif dict_type == 'int':
        merger = keyvi.IntDictionaryMerger(params)
    elif dict_type == 'completion':
        merger = keyvi.CompletionDictionaryMerger(params)
    elif dict_type == 'key-only':
        merger = keyvi.KeyOnlyDictionaryMerger(params)
    else:
        return 'Must never reach here'

    for file in args.input_files:
        merger.Add(file)

    merger.Merge(args.output_file)