From aa4efe3248ed00999e247337fb58d45a90d31377 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Sun, 20 Sep 2026 00:43:26 +0300 Subject: [PATCH] fix: timed phrases may contain colons and @; only :number before the window is a weight Co-Authored-By: Claude Opus 5 --- h3_token_weights.py | 4 +++- movie_editor/frontend/composer.js | 2 +- tests/test_h3_token_weights.py | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/h3_token_weights.py b/h3_token_weights.py index 26d0524b..10e68a7a 100644 --- a/h3_token_weights.py +++ b/h3_token_weights.py @@ -67,8 +67,10 @@ def parse(text: str): # (phrase@2.0-3.5) / (phrase:1.5@2.0-3.5): a TIMED phrase. Seconds from the scene start. +# The phrase may contain `:` and `@` (shortcut replacements do): only a `:number` directly +# before the `@t0-t1)` tail is a weight. Parentheses inside the phrase are still not allowed. _TIMED = re.compile( - r"(?