Closed jschalk closed 1 month ago
This pull request implements changes to the BridgeUnit class and related functionality in the filter module. The changes include refactoring existing methods, adding new methods for handling explicit label maps, and improving the overall structure and functionality of the BridgeUnit class. Additionally, new test files have been added to cover the new and modified functionality.
classDiagram
class BridgeUnit {
-atom_arg: str
-src_to_dst: dict
-unknown_word: str
-src_road_delimiter: str
-dst_road_delimiter: str
-explicit_label_map: dict
-_calc_atom_python_type: str
+set_atom_arg(x_atom_arg: str)
+set_all_src_to_dst(x_src_to_dst: dict, raise_exception_if_invalid: bool)
+set_src_to_dst(src_word: str, dst_word: str)
+_get_dst_value(src_word: str): str
+get_create_dst(src_word: str, missing_add: bool): str
+_get_create_roadunit_dst(src_road): RoadUnit
+_get_explicit_roadnode(x_roadNode: RoadNode): RoadNode
+src_to_dst_exists(src_word: str, dst_word: str): bool
+src_exists(src_word: str): bool
+del_src_to_dst(src_word: str)
+set_explicit_label_map(src_label: RoadNode, dst_label: RoadNode)
+_get_explicit_dst_label(src_label: RoadNode): RoadNode
+explicit_label_map_exists(src_label: RoadNode, dst_label: RoadNode): bool
+explicit_src_label_exists(src_label: RoadNode): bool
+del_explicit_label_map(src_label: RoadNode)
+_unknown_word_in_src_to_dst(): bool
+_src_road_delimiter_in_src_words(): bool
+_dst_road_delimiter_in_src_words(): bool
+_src_road_delimiter_in_dst_words(): bool
+_dst_road_delimiter_in_dst_words(): bool
+_is_src_delimiter_inclusion_correct(): bool
+_is_dst_delimiter_inclusion_correct(): bool
+all_src_parent_roads_exist(): bool
+is_valid(): bool
+get_dict(): dict
+get_json(): str
}
Change | Details | Files |
---|---|---|
Refactored and enhanced BridgeUnit class |
|
src/f09_filter/bridge.py src/f09_filter/test/test_birdgeunit_.py |
Added new test files for BridgeUnit functionality |
|
src/f09_filter/test/test_birdgeunit_get_create_dst.py src/f09_filter/test/test_birdgeunit_dict.py src/f09_filter/test/test_birdgeunit_delimiter.py |
Updated dict_tool functions |
|
src/f00_instrument/dict_tool.py |
Summary by Sourcery
Enable explicit label mapping in the BridgeUnit class and refactor its handling of delimiters. Add extensive tests to ensure the correctness of the new and existing functionalities.
New Features:
Enhancements:
Tests: