Created
November 15, 2023 05:36
-
-
Save liamzebedee/97c465fe3ad482c81be4561aec673f80 to your computer and use it in GitHub Desktop.
The architecture of an open-source AI TV show: part 004.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Given TV script | |
tv_script = """ | |
[The scene opens in Rick's Garage. Rick is tinkering with a complex-looking gadget while Morty leans against a table, eyeing Rick curiously.] | |
Rick: Morty, hand me the interdimensional portalizer, will ya? | |
[Morty rummages through a pile of gadgets and tools, finally handing the portalizer to Rick.] | |
Morty: Here you go, Rick. What are you up to this time? | |
[Rick attaches a few wires and fiddles with the device, creating a portal shimmering with blue and green hues.] | |
""" | |
# Regular expression pattern to find text within square brackets | |
pattern = r'\[(.*?)\]' | |
# Find all matches of text within square brackets | |
matches = re.findall(pattern, tv_script) | |
# Assuming the first match represents the stage/setting | |
if matches: | |
stage_setting = matches[0] | |
print("Stage/Setting:", stage_setting) | |
else: | |
print("No stage/setting found in the script.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment