diff --git a/app_spec.yml b/app_spec.yml index 9bee7ca..cd18fe1 100644 --- a/app_spec.yml +++ b/app_spec.yml @@ -2,29 +2,23 @@ '所求之事': value_type: str description: '所求之事' - pray: - name: pray + '祈祷': value_type: str description: '祈祷' output: - origin_hexagram: - name: origin_hexagram + '本卦': value_type: str description: '本卦' - support_hexagram: - name: support_hexagram + '变卦': value_type: str description: '变卦' - turn_symbol_desc: - name: turn_symbol_desc + '说明': value_type: str description: '说明' - main_indicate: - name: main_indicate + '主预言': value_type: str description: '主预言' - support_indicate: - name: support_indicate + '辅预言': value_type: str description: '辅预言' diff --git a/handler.py b/handler.py index fd5d9e1..d35b707 100644 --- a/handler.py +++ b/handler.py @@ -11,26 +11,29 @@ """ # get the input params - wish = conf['wish'] # value_type: str # description: some description - pray = conf['pray'] + wish = conf['所求之事'] # value_type: str # description: some description + pray = conf['祈祷'] # predict obj = YiProgram() origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray) # return results - return dict( - origin_hexagram=origin_hexagram, - support_hexagram=origin_hexagram, - turn_symbol_desc=turn_symbol_desc, - main_indicate=main_indicate, - support_indicate=support_indicate - ) + return { + '本卦': origin_hexagram, + '变卦': support_hexagram, + '说明': turn_symbol_desc, + '主预言': main_indicate, + '辅语言': support_indicate + } if __name__ == '__main__': wish = '希望' pray = '祈祷' - conf = dict(wish=wish, pray=pray) + conf = { + '所求之事': wish, + '祈祷': pray + } results = handle(conf) print('results:\n', results)