Skip to content

Commit

Permalink
add disrespect_decoded_annotations parameter to parse_with_error_hand…
Browse files Browse the repository at this point in the history
…ling()
  • Loading branch information
ArneBinder committed Feb 19, 2024
1 parent 5dd3c1b commit 33e6a1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pie_modules/taskmodules/common/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def parse_with_error_handling(
stop_ids: List[int],
errors: Optional[Dict[str, int]] = None,
decoded_annotations: Optional[List[A]] = None,
disrespect_decoded_annotations: bool = False,
) -> Tuple[List[A], Dict[str, int], List[int]]:
errors = errors or defaultdict(int)
decoded_annotations = decoded_annotations or []
Expand All @@ -84,7 +85,9 @@ def parse_with_error_handling(
try:
valid_encoding, remaining = self.parse(
encoding=remaining,
decoded_annotations=decoded_annotations,
decoded_annotations=decoded_annotations
if not disrespect_decoded_annotations
else [],
text_length=input_length,
)
decoded_annotations.append(valid_encoding)
Expand Down

0 comments on commit 33e6a1b

Please sign in to comment.