| 10 | 10 |
"""
|
| 11 | 11 |
|
| 12 | 12 |
# 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['祈祷']
|
| 15 | 15 |
|
| 16 | 16 |
# predict
|
| 17 | 17 |
obj = YiProgram()
|
| 18 | 18 |
origin_hexagram, support_hexagram, turn_symbol_desc, main_indicate, support_indicate = obj.predict(wish, pray)
|
| 19 | 19 |
|
| 20 | 20 |
# 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 |
}
|
| 28 | 28 |
|
| 29 | 29 |
if __name__ == '__main__':
|
| 30 | 30 |
wish = '希望'
|
| 31 | 31 |
pray = '祈祷'
|
| 32 | |
conf = dict(wish=wish, pray=pray)
|
|
32 |
conf = {
|
|
33 |
'所求之事': wish,
|
|
34 |
'祈祷': pray
|
|
35 |
}
|
| 33 | 36 |
results = handle(conf)
|
| 34 | 37 |
print('results:\n', results)
|
| 35 | 38 |
⏎
|