# coding=utf-8
from __future__ import absolute_import, unicode_literals

from rpc.decorators import bind
from rpc.cache import search_dic_cache
from search.utils.dic import DIC_CACHE_KEY
import re
import json


@bind('search/dict/get')
def get_dict():
    dic_data = search_dic_cache.get(DIC_CACHE_KEY)
    if dic_data:
        return json.loads(dic_data)
    else:
        return {}  # shouldn't been executed!
