Count Bracket Number, 0 indicate num_left = num_right :param tree_str: :return:
(tree_str)
| 33 | return ' '.join(new_text_list) # 空格组合对于中文效果? |
| 34 | |
| 35 | def find_bracket_num(tree_str): |
| 36 | """ |
| 37 | Count Bracket Number, 0 indicate num_left = num_right |
| 38 | :param tree_str: |
| 39 | :return: |
| 40 | """ |
| 41 | count = 0 |
| 42 | for char in tree_str: |
| 43 | if char == left_bracket: |
| 44 | count += 1 |
| 45 | elif char == right_bracket: |
| 46 | count -= 1 |
| 47 | else: |
| 48 | pass |
| 49 | return count |
| 50 | |
| 51 | |
| 52 | def check_well_form(tree_str): |
no outgoing calls
no test coverage detected