Simpsons Search
Use this skill to find Simpsons quotes and episode scripts without stuffing a giant corpus into context.
Source
Primary source:
Preferred approach:
- - keep a local episode index with titles + URLs
- optionally build a local searchable corpus cache for better quote accuracy
- fetch individual script pages when needed or while building the corpus
- return short excerpts plus the source link
Default to the index first. Build the corpus when the user wants stronger quote/scene search quality.
Workflow
- 1. Read the local index at
references/simpsons-episodes.json if it exists. - If the index is missing or stale, refresh it with
scripts/build_index.py. - Search the index by episode title when the user asks for a known episode.
- Search the website or fetched script text when the user asks for:
- a quote fragment
- a scene description
- a character/topic pattern
- 5. When the user wants a character voice or impression, read
references/simpsons-characters.json or use the helper scripts first. - Return:
- episode title or character name
- script URL when relevant
- a short excerpt, summary, or character brief
- note when the match is approximate
Files
- -
references/simpsons-episodes.json — local metadata index of episode titles and URLs - INLINECODE5 — cached fetched script pages
- INLINECODE6 — optional local searchable corpus cache
- INLINECODE7 — grounded character briefs for impressions and style matching
- INLINECODE8 — script-derived evidence lines and episode presence for seeded characters
- INLINECODE9 — richer auto-built dossiers with top terms, related characters, and candidate catchphrases
- INLINECODE10 — rebuild the episode index from the source page
- INLINECODE11 — fetch/cache scripts and build a local searchable corpus
- INLINECODE12 — build a lightweight inverted index for faster quote lookups
- INLINECODE13 — synthesize richer character dossiers from the corpus
- INLINECODE14 — fuzzy local search over the index
- INLINECODE15 — quote/topic search using the search index + local corpus when available, otherwise cached fetched pages
- INLINECODE16 — fuzzy character lookup over the local character briefs
- INLINECODE17 — human-readable character brief and imitation prompt
- INLINECODE18 — derive character evidence snippets from the local script corpus
- INLINECODE19 — build a rewrite/imitation prompt package for a target character
- INLINECODE20 — assemble a direct style guide package for replying as a chosen character
Common tasks
Find by title
Run:
CODEBLOCK0
Then fetch the matched page if needed.
Find by quote fragment or topic
Run:
CODEBLOCK1
Behavior:
- 1. Prefer the local corpus if
references/simpsons-corpus.json exists. - Otherwise use the local index to shortlist candidates and fetch/cache likely script pages.
- Rank matches by phrase hit, term coverage, and term frequency.
- Return short excerpts with source links.
To build the stronger corpus cache:
CODEBLOCK2
Find a character voice
Run:
CODEBLOCK3
Use the returned brief before writing in-character text. Base the imitation on role, traits, rhythm, themes, and recurring attitudes.
To ground the brief with script evidence:
CODEBLOCK4
To generate a rewrite prompt package:
CODEBLOCK5
To build richer dossiers:
CODEBLOCK6
To get a direct speaking-style package:
CODEBLOCK7
Notes
- - The local index is for discovery, not full-text script storage.
- The corpus improves quote accuracy but still depends on script-source quality.
- Character briefs are grounded style guides, not a claim of perfect canon simulation.
- If a quote search needs broader coverage, search the web first, then fetch the specific script page.
- Be explicit when the source appears user-maintained or imperfect.
- Keep excerpts short and useful.
辛普森搜索
使用此技能查找辛普森台词和剧集剧本,无需将庞大的语料库加载到上下文中。
来源
主要来源:
- - https://www.springfieldspringfield.co.uk/episode_scripts.php?tv-show=the-simpsons
推荐方法:
- - 维护包含标题和URL的本地剧集索引
- 可选地构建本地可搜索语料库缓存,以提高台词准确性
- 在需要时或构建语料库时获取单个剧本页面
- 返回简短摘录及来源链接
默认优先使用索引。当用户需要更强的台词/场景搜索质量时,再构建语料库。
工作流程
- 1. 如果存在,读取本地索引 references/simpsons-episodes.json。
- 如果索引缺失或过期,使用 scripts/build_index.py 刷新。
- 当用户询问已知剧集时,按剧集标题搜索索引。
- 当用户询问以下内容时,搜索网站或已获取的剧本文本:
- 台词片段
- 场景描述
- 角色/主题模式
- 5. 当用户需要角色声音或模仿时,首先读取 references/simpsons-characters.json 或使用辅助脚本。
- 返回:
- 剧集标题或角色名称
- 相关剧本URL
- 简短摘录、摘要或角色简介
- 匹配为近似时注明
文件
- - references/simpsons-episodes.json — 剧集标题和URL的本地元数据索引
- references/cache/ — 缓存的已获取剧本页面
- references/simpsons-corpus.json — 可选的本地可搜索语料库缓存
- references/simpsons-characters.json — 用于模仿和风格匹配的扎实角色简介
- references/simpsons-character-evidence.json — 从剧本中提取的证据台词和种子角色的剧集出现情况
- references/simpsons-character-dossiers.json — 更丰富的自动构建档案,包含高频词汇、相关角色和候选口头禅
- scripts/buildindex.py — 从源页面重建剧集索引
- scripts/buildcorpus.py — 获取/缓存剧本并构建本地可搜索语料库
- scripts/buildsearchindex.py — 构建轻量级倒排索引以加快台词查找
- scripts/buildcharacterdossiers.py — 从语料库合成更丰富的角色档案
- scripts/findepisode.py — 在索引上进行模糊本地搜索
- scripts/findquote.py — 使用搜索索引和本地语料库(如有)进行台词/主题搜索,否则使用缓存的已获取页面
- scripts/findcharacter.py — 在本地角色简介上进行模糊角色查找
- scripts/characterbrief.py — 人类可读的角色简介和模仿提示
- scripts/extractcharacterevidence.py — 从本地剧本语料库中提取角色证据片段
- scripts/rewriteascharacter.py — 为目标角色构建重写/模仿提示包
- scripts/speakascharacter.py — 组装直接风格指南包,以所选角色身份回复
常见任务
按标题查找
运行:
bash
python3 scripts/find_episode.py steamed hams
然后根据需要获取匹配的页面。
按台词片段或主题查找
运行:
bash
python3 scripts/find_quote.py steamed hams
行为:
- 1. 如果 references/simpsons-corpus.json 存在,优先使用本地语料库。
- 否则使用本地索引筛选候选页面并获取/缓存可能的剧本页面。
- 按短语命中率、术语覆盖率和术语频率对匹配结果排序。
- 返回带有来源链接的简短摘录。
要构建更强的语料库缓存:
bash
python3 scripts/build_corpus.py
python3 scripts/buildsearchindex.py
查找角色声音
运行:
bash
python3 scripts/find_character.py mr burns
python3 scripts/character_brief.py mr burns
在撰写角色文本前使用返回的简介。基于角色、特质、节奏、主题和反复出现的态度进行模仿。
要使用剧本证据支撑简介:
bash
python3 scripts/extractcharacterevidence.py
要生成重写提示包:
bash
python3 scripts/rewriteascharacter.py moe i cant believe this meeting is still going
要构建更丰富的档案:
bash
python3 scripts/buildcharacterdossiers.py
要获取直接说话风格包:
bash
python3 scripts/speakascharacter.py mr burns complain about modern coffee shops
备注
- - 本地索引用于发现,而非全文剧本存储。
- 语料库提高台词准确性,但仍取决于剧本来源质量。
- 角色简介是扎实的风格指南,并非声称完美还原正典。
- 如果台词搜索需要更广覆盖,先搜索网络,再获取特定剧本页面。
- 当来源看似由用户维护或不完美时,需明确说明。
- 保持摘录简短且有用。