diff --git a/shot_camera.py b/shot_camera.py index d281471d..4d9a49f6 100644 --- a/shot_camera.py +++ b/shot_camera.py @@ -33,7 +33,7 @@ _CAMERA_VERBS = (r"(?:moves?|pushes|pulls|pans|tilts|zooms|tracks|follows|drifts r"starts|begins|continues|lingers|settles|zoom|pan|tilt|push|pull)") CAMERA = re.compile( r"\b(?:zoom(?:s|ed|ing)?\s+(?:in|out)|zoom-(?:in|out)|dolly|rack(?:s|ing)? focus|close-?up|" - r"pov|handheld|wide shot|wide-angle shot|tracking shot|crane shot|static shot|whip pan|" + r"handheld|wide shot|wide-angle shot|tracking shot|crane shot|static shot|whip pan|" r"push[- ]in|pull[- ]out|camera shake)\b" r"|\bcamera(?:'s)?\s+(?:\w+ly\s+)?" + _CAMERA_VERBS + r"\b" r"|\bcamera(?:'s)? (?:movement|motion|move)\b" diff --git a/tests/test_shot_camera.py b/tests/test_shot_camera.py index 5a650dea..0ae8f6ed 100644 --- a/tests/test_shot_camera.py +++ b/tests/test_shot_camera.py @@ -332,3 +332,18 @@ def test_shortcut_texts_come_from_the_library(monkeypatch): "b": {"enabled": False, "replacements": ["Disabled but long enough text."]}, "c": {"enabled": True, "replacements": ["short"]}}}) assert conditioning._shortcut_texts() == ["A long enough replacement text."] + + +@pytest.mark.parametrize("view", sc.VIEWS) +def test_a_view_is_not_a_camera_move(view): + assert not sc.CAMERA.search(sc.CUT.sub("", view + ".")) + + +def test_a_shot_that_was_given_a_view_still_gets_its_move(): + pytest.importorskip("spacy") + p = HEAD + "[Shot 1] waves. [Shot 2] touches 's chin." + for seed in range(12): + viewed, added = sc.add_shot_views(p, seed=seed, chance=1.0) + assert added + _out, rep = sc.add_camera_moves(viewed, seed=seed, chance=1.0) + assert rep[1]["move"], (added, rep[1]["why"])