规则语法中能否支持定义二维数组
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 281
- PR merge metrics
- No merged PRs in 30d
Description
rule "rule_decision_matrix_user_level" "" salience 1
begin
rule_decision_matrix_user_level_matrix = map[string]map[string]string{"1": {"1":
"D", "2": "D", "3": "D", "4": "D"}, "2": {"1": "D", "2": "D", "3": "D", "4":
"D"}, "3": {"1": "D", "2": "D", "3": "D", "4": "D"}, "4": {"1": "C", "2": "C",
"3": "C", "4": "C"}, "5": {"1": "C", "2": "C", "3": "C", "4": "B"}, "6": {"1":
"B", "2": "B", "3": "B", "4": "B"}, "7": {"1": "A", "2": "B", "3": "B", "4":
"B"}, "8": {"1": "A", "2": "A", "3": "A", "4": "A"}}
tmp_rule_decision_matrix_user_level_matrix = rule_decision_matrix_user_level_matrix[score_level]
resp["user_level"] = tmp_rule_decision_matrix_user_level_matrix[approve_periods]
return resp
end
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the rule-language parser and map-literal handling to see how nested values are currently represented. Use the provided rule_decision_matrix_user_level example as the acceptance case; done means the rule parses and evaluates the two-dimensional map lookups correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100