8b27389
LMonan 3 years ago
2 changed file(s) with 19 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
11 '所求之事':
22 value_type: str
33 description: '所求之事'
4 pray:
5 name: pray
4 '祈祷':
65 value_type: str
76 description: '祈祷'
87 output:
9 origin_hexagram:
10 name: origin_hexagram
8 '本卦':
119 value_type: str
1210 description: '本卦'
13 support_hexagram:
14 name: support_hexagram
11 '变卦':
1512 value_type: str
1613 description: '变卦'
17 turn_symbol_desc:
18 name: turn_symbol_desc
14 '说明':
1915 value_type: str
2016 description: '说明'
21 main_indicate:
22 name: main_indicate
17 '主预言':
2318 value_type: str
2419 description: '主预言'
25 support_indicate:
26 name: support_indicate
20 '辅预言':
2721 value_type: str
2822 description: '辅预言'
2923
1010 """
1111
1212 # get the input params
13 wish = conf['wish'] # value_type: str # description: some description
14 pray = conf['pray']
13 wish = conf['所求之事'] # value_type: str # description: some description
14 pray = conf['祈祷']
1515
1616 # predict
1717 obj = YiProgram()
1818 origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray)
1919
2020 # return results
21 return dict(
22 origin_hexagram=origin_hexagram,
23 support_hexagram=origin_hexagram,
24 turn_symbol_desc=turn_symbol_desc,
25 main_indicate=main_indicate,
26 support_indicate=support_indicate
27 )
21 return {
22 '本卦': origin_hexagram,
23 '变卦': support_hexagram,
24 '说明': turn_symbol_desc,
25 '主预言': main_indicate,
26 '辅语言': support_indicate
27 }
2828
2929 if __name__ == '__main__':
3030 wish = '希望'
3131 pray = '祈祷'
32 conf = dict(wish=wish, pray=pray)
32 conf = {
33 '所求之事': wish,
34 '祈祷': pray
35 }
3336 results = handle(conf)
3437 print('results:\n', results)
3538