From 8f4b489e8c5936209c224c300b59866d60c7171d Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Fri, 13 Jun 2025 12:09:13 +0200 Subject: [PATCH] Fix floating point lm parsing --- gen-test-data/gen_test_data.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gen-test-data/gen_test_data.py b/gen-test-data/gen_test_data.py index 0414649..63898a2 100644 --- a/gen-test-data/gen_test_data.py +++ b/gen-test-data/gen_test_data.py @@ -12,18 +12,8 @@ def parse_lm_pairs(lm_str: str) -> Tuple[float]: - """ - Regular expression to capture pairs of floats within parentheses - ( : Matches the opening parenthesis - -? : Optionally matches a minus sign (for negative numbers) - \d+ : Matches one or more digits - \. : Matches the literal dot (for decimal numbers) - \d* : Matches zero or more digits after the decimal point - , : Matches the comma separator - \s* : Matches zero or more whitespace characters - ) : Matches the closing parenthesis - """ - pattern = re.compile(r"\(([-]?\d+\.?\d*),\s*([-]?\d+\.?\d*)\)") + # Regular expression to capture pairs of floats within comma-separated parentheses + pattern = re.compile(r"\((.*?),\s*(.*?)\)") lm = []