网页 综合 更新时间 2026-10-31 20:17:47

Halloween started in Ireland. I put a century of Irish ghost stories back on the map, and code wouldn't let the AI invent a single place - DEV Community

自动蜘蛛 dev.to 正文约 6000 字
Halloween started in Ireland. I put a century of Irish ghost stories back on the map, and code wouldn't let the AI invent a single place - DEV Community
Posted on Oct 31 • AI-assisted
Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
Halloween started here. Long before plastic pumpkins, Samhain was the night at the end of October when the Irish said the wall between this world and the other one wore thin, and the dead walked the roads.
I live in Ireland. In the 1890s an American folklorist, Jeremiah Curtin, sat by firesides in Kerry and wrote down what people told him: a man walking to Sneem at night who meets a ghost and fights it off with a steel sword, a midwife carried away to a fairy fort on a horse that turns out to be a plough beam, a dead mother walking a strand at night, perishing with the cold, asking for a pair of shoes to be given to the poor in her name. He printed thirty of them in 1895 as Tales of the Fairies and of the Ghost World.
Every one of those tales happens somewhere real. The road to Sneem. Blackwater bridge. Ventry strand. You can still walk most of them. But in the book they're just words on a page, and the old spellings (Lochlein, Rahonain) don't match any modern map.
Kerry is only one corner, though. So I added a second public-domain book: True Irish Ghost Stories (1914), compiled by a Tipperary rector, St John D. Seymour, and a police district inspector, Harry L. Neligan, from accounts people sent in from all over the country: haunted houses in Dublin squares, banshees, poltergeists, RIC barracks with something in them besides the police.
So I built Samhain Map: click a place anywhere in Ireland and read the ghost stories that happened there.
A story on a phone: Curtin's own words, in type close to how they were first printed, with the scanned 1895 page one tap away.
The rule behind all of it: Gemma reads. Code decides.
Live: samhain-map.onrender.com (no sign-up, works on a phone)
Try: filter by Ghost, click Sneem, open The Ghost of Sneem, then scroll to "Where it happened". Then zoom into Dublin Bay and click Dún Laoghaire: the 1914 story calls it Kingstown. Or click any white ghost, like Leap Castle, open its story and press play under "Listen to the story". Headphones, lights off.
Irish ghost and fairy stories from two public-domain books, put back on the map.
An open-weight model (Gemma 4) reads each story: what haunts it, a one-line summary, and which places it names. Plain code then checks every answer before anything is pinned on the map.
Gemma reads. Code decides.
For every place, Gemma has to return the place and the exact words it came from. Code then checks two things: the quote is really in the tale, and the name is really in the quote. If either fails, the place is refused, and the map says so.
Across Curtin's 30 tales, Gemma reported 95 place names. Two failed the quote check, and they surprised me: neither was invented. Both places are really in the tales. Gemma just changed one word while copying:
I kept the rule strict anyway. A checker that lets "close enough" through is a checker that will one day let a made-up townland through. Losing two pins is the cheaper mistake. (The 1914 book added 223 more place names; three more failed the same check.)
A name that passes the quote check still isn't pinned until it matches a real place: one of 59,618 townlands (Tailte Éireann for the 26 counties, OSNI Open Data for the six in the North), or a town, hill, lake or bridge from GeoNames. "Munster", "Co. Kerry" or "the North of Ireland" are listed but never pinned: too broad to be a place you could stand.
Many names exist more than once. Ireland has 41 places called Derry and 49 called Curragh. Code decides, in this order:
That Kingstown is my favourite fix. Co. Dublin has three townlands called Kingstown, so code refused, until Gemma's modern name for it, Dún Laoghaire, turned out to be exactly one town in the county the story names. Kingstown is the old name for Dún Laoghaire.
True Irish Ghost Stories runs 124 accounts together inside ten chapters. I didn't let Gemma rewrite or split the text. It sees each chapter with numbered paragraphs and answers only "account starts at paragraph 4, call it The Spectral Charwoman". Code checks the numbers exist and does the cutting, so every word on the map is the book's. The titles of those stories are Gemma's, and each one says so.
Leap Castle is the one everyone in Ireland names. The 1914 book has it, but under a made-up name: "Kilman" Castle, "perhaps the worst haunted mansion in the British Isles". Seymour gives the clue himself: its owner wrote about it in the Occult Review in December 1908. That was Mildred Darby of Leap Castle, and the site page says so and links the source.
The sites are a short hand-picked list, but nothing on it is taken on trust. For each one, code checks that its quote is word for word in exactly one story, and takes the location from the same gazetteer as everything else. Only Charles Fort and Dunseverick Castle, which the gazetteer doesn't have, use Wikipedia's coordinates, and say so. Gill Hall, home of the famous Beresford ghost, is in the 1914 book, but I couldn't find a source for exactly where the house stood, so it isn't a ghost on the map.
Each site has an image from Wikimedia Commons, taken only if its licence is free (all turned out CC BY-SA) and credited on the page. Kilkea Castle has none: Commons tags its postcard CC BY-SA, but the postcard's own credit line says CC BY-NC, and when two licences disagree I leave the image out.
These stories were told by a fire long before anyone wrote them down, so reading them silently felt like half of them. Twelve, about 69 minutes in all, are now read aloud by an ElevenLabs voice ("George", an older storyteller), set slow and slightly unsteady: lower stability so the voice can drop and linger, speed at 0.9.
The same rule holds: the voice reads only the book's own words and the story's title, nothing generated. The audio is made once by a script and served as small s
访问原文 返回搜索 https://dev.to/srgcy/halloween-started-in-ireland-i-put-a-century-of-irish-ghost-stories-back-on-the-map-and-code-18m1
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。