{\n "bread": [\n "sourdough",\n "Wonderbread",\n "flatbread",\n "multigrain",\n "naan",\n "soda bread",\n "texas toast",\n "unleavened",\n "whole wheat",\n "bagel",\n "baguette",\n "banana bread",\n "beer bread",\n "biscuit",\n "brioche",\n "chickpea",\n "cornbread",\n "crouton",\n "pancake",\n "english muffin",\n "focaccia",\n "hardtack",\n "matzo",\n "milk toast",\n "pita",\n "potato",\n "pretzel",\n "rye",\n "sprouted rye",\n "scone",\n "tortilla",\n "cardboard"\n ],\n "style": [\n "Chicago style",\n "New York style",\n "thin crust",\n "deep dish",\n "hand tossed",\n "Sicilian",\n "Midgardian",\n "deconstructed",\n "California style",\n "Neopolitan"\n ],\n "unfood": [\n "nails",\n "motor oil",\n "ennui",\n "bees",\n "souls",\n "coffee grounds",\n "easter grass",\n "packing peanuts",\n "sand",\n "mud",\n "uraniuim",\n "aluminum shavings",\n "wood chips",\n "hair",\n "pencil shavings",\n "crayon",\n "blood",\n "dirt",\n "spiders",\n "pebbles"\n ],\n "kind": [\n "white",\n "alfredo",\n "pesto",\n "marinara",\n "margherita"\n ],\n "topphrase": [\n "drizzled with #topping#",\n "with a reduction of #topping#",\n "served with a #topping# and #topping# dipping sauce"\n ],\n "ingredient": [\n "a�ai berry",\n "apple",\n "apricot",\n "avocado",\n "banana",\n "bilberry",\n "black raspberry",\n "blackberry",\n "blackcurrant",\n "blood orange",\n "blueberry",\n "boysenberry",\n "cantaloupe",\n "cantaloupe",\n "cherimoya",\n "cherry",\n "clementine",\n "cloudberry",\n "coconut",\n "cranberry",\n "currant",\n "damson",\n "date",\n "dragonfruit",\n "durian",\n "elderberry",\n "feijoa",\n "fig",\n "goji berry",\n "gooseberry",\n "grape",\n "grapefruit",\n "guava",\n "honeydew",\n "huckleberry",\n "jabouticaba",\n "jackfruit",\n "jambul",\n "jujube",\n "juniper berry",\n "kiwano",\n "kiwi fruit",\n "kumquat",\n "lemon",\n "lime",\n "loquat",\n "lychee",\n "mandarine",\n "mango",\n "marion berry",\n "melon",\n "miracle fruit",\n "mulberry",\n "nectarine",\n "olive",\n "orange",\n "papaya",\n "passionfruit",\n "peach",\n "pear",\n "persimmon",\n "physalis",\n "pineapple",\n "plum",\n "pomegranate",\n "pomelo",\n "pumpkin",\n "purple mangosteen",\n "quince",\n "raisin",\n "rambutan",\n "raspberry",\n "redcurrant",\n "salal berry",\n "salmon berry",\n "satsuma",\n "squash",\n "star fruit",\n "strawberry",\n "tamarillo",\n "tangerine",\n "tomato",\n "ugli fruit",\n "watermelon",\n "acorn squash",\n "alfalfa sprouts",\n "amaranth",\n "artichoke",\n "arugula",\n "asparagus",\n "azuki beans",\n "banana squash",\n "bean sprouts",\n "beet",\n "black beans",\n "black-eyed peas",\n "bok choy",\n "borlotti bean",\n "broad beans",\n "broccoflower",\n "broccoli",\n "brussels sprouts",\n "butternut squash",\n "cabbage",\n "calabrese",\n "cannabis",\n "carrot",\n "carrots",\n "cauliflower",\n "celeriac",\n "celery",\n "chard",\n "chickpeas",\n "chili peppers",\n "chives",\n "collard greens",\n "corn",\n "corn salad",\n "cucumber",\n "daikon",\n "delicata",\n "eggplant",\n "endive",\n "fiddleheads",\n "frisee",\n "garlic",\n "gem squash",\n "ginger",\n "green beans",\n "green peppers",\n "habanero",\n "horseradish",\n "hubbard squash",\n "jalapeno",\n "jerusalem artichoke",\n "jicama",\n "kale",\n "kidney beans",\n "kohlrabi",\n "leek",\n "legumes",\n "lentils",\n "lettuce",\n "lima beans",\n "mung beans",\n "mushrooms",\n "mustard greens",\n "navy beans",\n "nettles",\n "new zealand spinach",\n "okra",\n "onion",\n "parsley",\n "parsnip",\n "peas",\n "peppers",\n "pinto beans",\n "potato",\n "pumpkin",\n "radicchio",\n "radish",\n "rhubarb",\n "root vegetables",\n "runner beans",\n "rutabaga",\n "rutabaga",\n "salsify",\n "scallions",\n "shallot",\n "skirret",\n "snap peas",\n "soy beans",\n "spaghetti squash",\n "spinach",\n "squash",\n "sweet potato",\n "taro",\n "tat soi",\n "tomato",\n "topinambur",\n "tubers",\n "turnip",\n "turnip",\n "wasabi",\n "water chestnut",\n "watercress",\n "white radish",\n "yam",\n "zucchini",\n "anise",\n "basil",\n "caraway",\n "chamomile",\n "cilantro seeds",\n "dill",\n "fennel",\n "lavender",\n "lemon grass",\n "marjoram",\n "oregano",\n "parsley",\n "rosemary",\n "sage",\n "thyme",\n "beef",\n "lamb",\n "pork",\n "mutton",\n "rabbit",\n "veal",\n "venison",\n "salmon",\n "tilapia",\n "chicken",\n "goose",\n "duck",\n "quail",\n "guinea hen",\n "white vinegar",\n "balsamic vinegar",\n "apple cider vinegar",\n "baking soda",\n "baking powder",\n "cocoa powder",\n "olive oil",\n "peanut oil",\n "coconut oil",\n "sea salt",\n "milled pepper",\n "almond flour",\n "dessicated coconut",\n "protein powder ",\n "flax seed meal",\n "chia seeds",\n "soy sauce",\n "worcestershire sauce",\n "jalapeno slices",\n "black olives",\n "ro-tel",\n "tea bags",\n "beef broth",\n "chicken broth",\n "pumpkin seeds",\n "sunflower seeds",\n "macadamia nuts",\n "almonds",\n "walnuts",\n "pine nuts",\n "cashews",\n "pecans ",\n "sun-dried tomatoes",\n "roasted red peppers",\n "artichoke hearts",\n "pesto",\n "alfredo sauce",\n "pumpkin",\n "instant coffee",\n "feta",\n "sharp cheddar",\n "shredded parmesan",\n "grated parmesan",\n "cream cheese",\n "mozzarella",\n "greek yogurt",\n "cottage cheese",\n "heavy white whipping cream",\n "butter",\n "sour cream",\n "egg",\n "boneless chicken breasts",\n "sliced pepperoni",\n "bacon",\n "genoa salami",\n "pepperoni stick",\n "green olives",\n "mayonnaise",\n "coconut milk",\n "yellow mustard",\n "relish",\n "red bell peppers",\n "lime juice",\n "barbecue sauce",\n "salt"\n ],\n "topping": [\n "#adj# #ingredient#",\n "#adj# #ingredient#",\n "#ingredient#",\n "#ingredient#",\n "#ingredient#",\n "#ingredient#",\n "#ingredient#",\n "#ingredient#",\n "#unfood#",\n "#standardtopping#"\n ],\n "adj": [\n "house",\n "fresh",\n "fresh-caught",\n "wild",\n "locally grown",\n "artisinal",\n "house blend",\n "vegan",\n "organic",\n "humanely slaughtered",\n "fried",\n "breaded",\n "cooked",\n "broiled",\n "flash fried",\n "grass fed",\n "free range",\n "open source",\n "curse free",\n "ghost free",\n "high-octane",\n "proprietary",\n "vintage",\n "Asbestos-free",\n "crowdfunded",\n "freshly cut",\n "vintage",\n "non-alcoholic",\n "non-radioactive",\n "technicolor",\n "canned",\n "frozen",\n "dehydrated",\n "freeze-dried",\n "unsalted",\n "nonbenzodiazepine",\n "boneless",\n "100% Cotton",\n "stainless steel",\n "surgical steel",\n "sterling silver",\n "socially constructed",\n "invisible",\n "post-structuralist",\n "brutalist",\n "whole grain"\n ],\n "genadj": [\n "deconstructed"\n ],\n "standardtopping": [\n "pepperoni",\n "italian sausage",\n "smoked ham",\n "bacon",\n "ground beef",\n "chicken",\n "turkey",\n "anchovies",\n "green chile",\n "mushrooms",\n "black olives",\n "onions",\n "bell peppers",\n "tomatoes",\n "pineapple",\n "jalape�os",\n "artichoke hearts",\n "kalamata olives",\n "roasted red peppers",\n "sun-dried tomatoes",\n "spinach",\n "pine nuts",\n "cheddar",\n "feta",\n "provolone",\n "pepperoni",\n "sausage",\n "spicy italian sausage",\n "ham",\n "hickory-smoked bacon",\n "grilled all-white chicken",\n "fresh-sliced onions",\n "fresh-sliced green peppers",\n "baby portabella mushrooms",\n "fresh-sliced roma tomatoes",\n "black olives",\n "italian sausage",\n "pepperoni",\n "100% real beef",\n "pork sausage",\n "ham",\n "bacon pieces",\n "chicken",\n "green pepper",\n "red onion",\n "mushroom",\n "sliced jalape�os",\n "banana peppers",\n "black olives",\n "tomatoes",\n "anchovies"\n ],\n "sauce": [\n "ranch dressing",\n "greek dressing",\n "raspberry vinaigrette",\n "caesar dressing",\n "thousand island",\n "bleu cheese dressing",\n "honey mustard",\n "pesto",\n "queso",\n "guacamole",\n "cocktail sauce",\n "duck sauce",\n "romanesco",\n "whipped cream",\n "gravy",\n "aioli",\n "mayonnaise",\n "tartar sauce",\n "salsa verde",\n "buffalo sauce",\n "green chile",\n "tabasco",\n "sriracha",\n "bolognese",\n "ragu",\n "pico de gallo",\n "applesauce",\n "butterscotch sauce",\n "hershey syrup",\n "hot fudge",\n "cream",\n "half and half",\n "peach sauce",\n "yogurt",\n "tzatziki ",\n "hoisin sauce",\n "oyster sauce",\n "ponzu",\n "sweet and sour sauce",\n "fish sauce",\n "au jus",\n "vodka",\n "soy sauce",\n "mole",\n "mustard"\n ],\n "description": [\n "#bread# crust #style# #kind# pizza with #topping#, #topping# and #topping#, #topphrase#",\n "#bread# #style# #kind# pizza with #topping#, #topping# and #topping#",\n "#style# #kind# pizza with #bread# crust and #topping#, #topping# and #topping#, #topphrase#",\n "#bread# crust pizza with #topping# crust, #topping#, #topping# and #topping#",\n "#bread# crust #style# #kind# pizza with #topping#, #topphrase#",\n "#bread# #style# #kind# pizza with #topping# and #topping#",\n "#style# #kind# pizza with #bread# crust and #topping#, #topphrase#",\n "#bread# #style# #kind# pizza with #topping#",\n "#bread# crust #style# #kind# pizza with #topping#",\n "#bread# crust #style# #kind# pizza with #topping# and #topping#. Served with a side of #sauce#"\n ],\n "origin": [\n "#specialname#: #description#. #fullprice#."\n ],\n "specialname": [\n "#personname# #ultimate#",\n "#personname#'s #ultimate#",\n "#topping.capitalizeAll# #lover#'s",\n "#italianword#",\n "#meat# #lover#'s",\n "#lover# of #meat#",\n "#italianword#"\n ],\n "personname": [\n "Jan",\n "Per",\n "Bj�rn",\n "Ole",\n "Lars",\n "Kjell",\n "Knut",\n "Svein",\n "Thomas",\n "Arne",\n "Geir",\n "Hans",\n "Morten",\n "Tor",\n "Martin",\n "Terje",\n "Erik",\n "Andreas",\n "Odd",\n "Anders",\n "John",\n "Rune",\n "Daniel",\n "Trond",\n "Tore",\n "Kristian",\n "Marius",\n "Jon",\n "Magnus",\n "Stian",\n "Tom",\n "Olav",\n "Henrik",\n "Harald",\n "Espen",\n "Fredrik",\n "�yvind",\n "Jonas",\n "Christian",\n "Eirik",\n "Gunnar",\n "Rolf",\n "Leif",\n "Nils",\n "H�kon",\n "Helge",\n "Einar",\n "Steinar",\n "Frode",\n "�ystein",\n "J�rgen",\n "Alexander",\n "Mathias",\n "Kjetil",\n "Petter",\n "Arild",\n "Emil",\n "Kristoffer",\n "Frank",\n "Stein",\n "Johan",\n "Dag",\n "Stig",\n "Kenneth",\n "K�re",\n "Vidar",\n "Ola",\n "Tommy",\n "P�l",\n "H�vard",\n "Ivar",\n "Adrian",\n "Roger",\n "Sondre",\n "Sverre",\n "Karl",\n "Magne",\n "Sebastian",\n "Simen",\n "Sander",\n "Eivind",\n "Robert",\n "Tobias",\n "Egil",\n "Vegard",\n "Kim",\n "Johannes",\n "Jens",\n "Alf",\n "Thor",\n "Roy",\n "Sindre",\n "Markus",\n "Sigurd",\n "Torbj�rn",\n "Benjamin",\n "Roar",\n "William",\n "Joakim",\n "Aleksander",\n "Mats",\n "Even",\n "Finn",\n "Erlend",\n "Erling",\n "Asbj�rn",\n "Jarle",\n "David",\n "Andre",\n "Elias",\n "Reidar",\n "Jostein",\n "Ove",\n "J�rn",\n "Oliver",\n "Ronny",\n "Atle",\n "Arvid",\n "Lasse",\n "Bjarne",\n "Jakob",\n "Henning",\n "Trygve",\n "Marcus",\n "Simon",\n "Inge",\n "Kai",\n "Anne",\n "Inger",\n "Kari",\n "Marit",\n "Ingrid",\n "Liv",\n "Eva",\n "Anna",\n "Maria",\n "Ida",\n "Hilde",\n "Berit",\n "Nina",\n "Marianne",\n "Astrid",\n "Elisabeth",\n "Bj�rg",\n "Kristin",\n "Randi",\n "Solveig",\n "Bente",\n "Heidi",\n "Silje",\n "Hanne",\n "Linda",\n "Tone",\n "Anita",\n "Elin",\n "Tove",\n "Wenche",\n "Gerd",\n "Camilla",\n "Ragnhild",\n "Ellen",\n "Hege",\n "Karin",\n "Ann",\n "Julie",\n "Mona",\n "Marie",\n "Monica",\n "Aud",\n "Else",\n "Kristine",\n "Laila",\n "Turid",\n "Stine",\n "Helene",\n "Mari",\n "Emma",\n "�se",\n "Jorunn",\n "Reidun",\n "Sissel",\n "Thea",\n "Line",\n "Lene",\n "Malin",\n "Mette",\n "Trine",\n "Sara",\n "Emilie",\n "Nora",\n "Grethe",\n "Unni",\n "Gunn",\n "Grete",\n "May",\n "Lise",\n "Anette",\n "Linn",\n "Siri",\n "Cecilie",\n "Marte",\n "Eli",\n "Irene",\n "Kirsten",\n "Ruth",\n "Gro",\n "Sofie",\n "Kjersti",\n "Britt",\n "Vilde",\n "Janne",\n "Ingeborg",\n "Siv",\n "Karoline",\n "Andrea",\n "Martine",\n "Sigrid",\n "Amalie",\n "Jenny",\n "Elise",\n "Frida",\n "Tonje",\n "Hanna",\n "Rita",\n "Cathrine",\n "Torill",\n "Karen",\n "Maren",\n "Lena",\n "Synn�ve",\n "Therese",\n "Ingvild",\n "Mia",\n "Lillian",\n "Charlotte",\n "Vigdis",\n "Brit",\n "Victoria",\n "Sandra",\n "Ingunn",\n "Signe",\n "Lisbeth",\n "Bodil",\n "Christine",\n "Oda",\n "Caroline",\n "Marthe",\n "Tina",\n "Merete",\n "Lisa",\n "Trude",\n "Henriette",\n "Vibeke",\n "Johanne",\n "Aar�n",\n "Abd�n",\n "Abel",\n "Abelardo",\n "Abrah�n",\n "Absal�n",\n "Acacio",\n "Adalberto",\n "Ad�n",\n "Adela",\n "Adelaida",\n "Adolfo",\n "Ad�n",\n "Adri�n",\n "Agust�n",\n "Aitor",\n "Alba",\n "Albert",\n "Alberto",\n "Albina",\n "Alejandra",\n "Alejandro",\n "Alejo",\n "Alfonso",\n "Alfredo",\n "Alicia",\n "Alipio",\n "Almudena",\n "Alonso",\n "�lvaro",\n "Amadeo",\n "Amaro",\n "Ambrosio",\n "Amelia",\n "Amparo",\n "Ana",\n "Anan�as",\n "Anastasia",\n "Anatolio",\n "Andrea",\n "Andr�s",\n "�ngel",\n "�ngela",\n "�ngeles",\n "Aniano",\n "Anna",\n "Anselmo",\n "Antero",\n "Antonia",\n "Antonio",\n "Aquiles",\n "Araceli",\n "Ar�nzazu",\n "Arcadio",\n "Aresio",\n "Ariadna",\n "Aristides",\n "Arnaldo",\n "Artemio",\n "Arturo",\n "Ascensi�n",\n "Asunci�n",\n "Atanasio",\n "Augusto",\n "�urea",\n "Aurelia",\n "Aureliano",\n "Aurelio",\n "Aurora",\n "Baldomero",\n "Balduino",\n "Baltasar",\n "B�rbara",\n "Bartolom�",\n "Basileo",\n "Beatriz",\n "Bego�a",\n "Bel�n",\n "Beltr�n",\n "Benedicto",\n "Benigno",\n "Benito",\n "Benjam�n",\n "Bernab�",\n "Bernarda",\n "Bernardo",\n "Blanca",\n "Blas",\n "Bonifacio",\n "Borja",\n "Bruno",\n "Calixto",\n "Camilo",\n "C�ndida",\n "Carina",\n "Carlos",\n "Carmelo",\n "Carmen",\n "Carolina",\n "Casiano",\n "Casimiro",\n "Casio",\n "Catalina",\n "Cayetano",\n "Cayo",\n "Cecilia",\n "Ceferino",\n "Celia",\n "Celina",\n "Celso",\n "C�sar",\n "Ces�reo",\n "Cipriano",\n "Cirilo",\n "Cirino",\n "Ciro",\n "Clara",\n "Claudia",\n "Claudio",\n "Cleof�s",\n "Clotilde",\n "Colombo",\n "Columba",\n "Columbano",\n "Concepci�n",\n "Conrado",\n "James",\n "John",\n "Robert",\n "Michael",\n "William",\n "David",\n "Richard",\n "Joseph",\n "Thomas",\n "Charles",\n "Christopher",\n "Daniel",\n "Matthew",\n "Anthony",\n "Donald",\n "Mark",\n "Paul",\n "Steven",\n "Andrew",\n "Kenneth",\n "George",\n "Joshua",\n "Kevin",\n "Brian",\n "Edward",\n "Ronald",\n "Timothy",\n "Jason",\n "Jeffrey",\n "Ryan",\n "Gary",\n "Jacob",\n "Nicholas",\n "Eric",\n "Stephen",\n "Jonathan",\n "Larry",\n "Justin",\n "Scott",\n "Frank",\n "Brandon",\n "Raymond",\n "Gregory",\n "Benjamin",\n "Samuel",\n "Patrick",\n "Alexander",\n "Jack",\n "Dennis",\n "Jerry",\n "Tyler",\n "Aaron",\n "Henry",\n "Douglas",\n "Jose",\n "Peter",\n "Adam",\n "Zachary",\n "Nathan",\n "Walter",\n "Harold",\n "Kyle",\n "Carl",\n "Arthur",\n "Gerald",\n "Roger",\n "Keith",\n "Jeremy",\n "Terry",\n "Lawrence",\n "Sean",\n "Christian",\n "Albert",\n "Joe",\n "Ethan",\n "Austin",\n "Jesse",\n "Willie",\n "Billy",\n "Bryan",\n "Bruce",\n "Jordan",\n "Ralph",\n "Roy",\n "Noah",\n "Dylan",\n "Eugene",\n "Wayne",\n "Alan",\n "Juan",\n "Louis",\n "Russell",\n "Gabriel",\n "Randy",\n "Philip",\n "Harry",\n "Vincent",\n "Bobby",\n "Johnny",\n "Logan",\n "Mary",\n "Patricia",\n "Jennifer",\n "Elizabeth",\n "Linda",\n "Barbara",\n "Susan",\n "Jessica",\n "Margaret",\n "Sarah",\n "Karen",\n "Nancy",\n "Betty",\n "Lisa",\n "Dorothy",\n "Sandra",\n "Ashley",\n "Kimberly",\n "Donna",\n "Carol",\n "Michelle",\n "Emily",\n "Amanda",\n "Helen",\n "Melissa",\n "Deborah",\n "Stephanie",\n "Laura",\n "Rebecca",\n "Sharon",\n "Cynthia",\n "Kathleen",\n "Amy",\n "Shirley",\n "Anna",\n "Angela",\n "Ruth",\n "Brenda",\n "Pamela",\n "Nicole",\n "Katherine",\n "Virginia",\n "Catherine",\n "Christine",\n "Samantha",\n "Debra",\n "Janet",\n "Rachel",\n "Carolyn",\n "Emma",\n "Maria",\n "Heather",\n "Diane",\n "Julie",\n "Joyce",\n "Evelyn",\n "Frances",\n "Joan",\n "Christina",\n "Kelly",\n "Victoria",\n "Lauren",\n "Martha",\n "Judith",\n "Cheryl",\n "Megan",\n "Andrea",\n "Ann",\n "Alice",\n "Jean",\n "Doris",\n "Jacqueline",\n "Kathryn",\n "Hannah",\n "Olivia",\n "Gloria",\n "Marie",\n "Teresa",\n "Sara",\n "Janice",\n "Julia",\n "Grace",\n "Judy",\n "Theresa",\n "Rose",\n "Beverly",\n "Denise",\n "Marilyn",\n "Amber",\n "Madison",\n "Danielle",\n "Brittany",\n "Diana",\n "Abigail",\n "Jane",\n "Natalie",\n "Lori",\n "Tiffany",\n "Alexis",\n "Kayla"\n ],\n "ultimate": [\n "Ultimate",\n "Special",\n "Gourmet",\n "Deluxe"\n ],\n "italianword": [\n "Affare",\n "Albero",\n "Alcuno",\n "Angolo",\n "Antico",\n "Attesa",\n "Attimo",\n "Attore",\n "Autore",\n "Azione",\n "Bestia",\n "Bianco",\n "Biondo",\n "Brutto",\n "Caff�",\n "Calcio",\n "Camera",\n "Capace",\n "Centro",\n "Chiaro",\n "Chiave",\n "Chiesa",\n "Citt�",\n "Civile",\n "Classe",\n "Colore",\n "Comodo",\n "Comune",\n "Cucina",\n "Denaro",\n "Destro",\n "Difesa",\n "Dolore",\n "Dovere",\n "Dubbio",\n "Enorme",\n "Errore",\n "Estate",\n "Estero",\n "Faccia",\n "Facile",\n "Famoso",\n "Fatica",\n "Favore",\n "Felice",\n "Fianco",\n "Figlia",\n "Figlio",\n "Figura",\n "Foglia",\n "Freddo",\n "Fresco",\n "Fretta",\n "Fronte",\n "Frutto",\n "Futuro",\n "Genere",\n "Giallo",\n "Giorno",\n "Giugno",\n "Giusto",\n "Grande",\n "Grazia",\n "Grigio",\n "Grosso",\n "Gruppo",\n "Guerra",\n "Inizio",\n "Intero",\n "Labbro",\n "Latino",\n "Lavoro",\n "Libero",\n "Limite",\n "Lingua",\n "Maggio",\n "Marito",\n "Medico",\n "Meglio",\n "Merito",\n "Minimo",\n "Minore",\n "Minuto",\n "Misura",\n "Moglie",\n "Morale",\n "Motivo",\n "Musica",\n "Natura",\n "Nemico",\n "Nobile",\n "Nostro",\n "Numero",\n "Occhio",\n "Ordine",\n "Pagina",\n "Parete",\n "Parola",\n "Patria",\n "Peggio",\n "Pianta",\n "Piazza",\n "Pietra",\n "Piet�",\n "Poesia",\n "Popolo",\n "Potere",\n "Povero",\n "Pranzo",\n "Prezzo",\n "Pronto",\n "Quadro",\n "Quanto",\n "Quarto",\n "Quello",\n "Questo",\n "Rapido",\n "Romano",\n "Sangue",\n "Scuola",\n "Secolo",\n "Sereno",\n "Sforzo",\n "Sicuro",\n "Simile",\n "Solito",\n "Spalla",\n "Spazio",\n "Specie",\n "Stampa",\n "Stanco",\n "Stanza",\n "Stella",\n "Stesso",\n "Storia",\n "Strada",\n "Strano",\n "Studio",\n "Tavola",\n "Tavolo",\n "Teatro",\n "Titolo",\n "Tratto",\n "Triste",\n "Troppo",\n "Uguale",\n "Ultimo",\n "Valore",\n "Vicino",\n "Visita",\n "Voglia",\n "Vostro",\n "Albergo",\n "Animale",\n "Aspetto",\n "Attento",\n "Attuale",\n "Azzurro",\n "Bambina",\n "Bambino",\n "Bisogno",\n "Braccio",\n "Capello",\n "Cattivo",\n "Cavallo",\n "Collina",\n "Cortile",\n "Cultura",\n "Destino",\n "Diretto",\n "Diritto",\n "Diverso",\n "Domanda",\n "Dottore",\n "Effetto",\n "Energia",\n "Esempio",\n "Estremo",\n "Europeo",\n "Fiducia",\n "Fortuna",\n "Giovane",\n "Governo",\n "Guardia",\n "Inglese",\n "Interno",\n "Inutile",\n "Inverno",\n "Istante",\n "Leggero",\n "Lettera",\n "Lontano",\n "Maestro",\n "Maniera",\n "Massimo",\n "Materia",\n "Mattina",\n "Mattino",\n "Memoria",\n "Mercato",\n "Milione",\n "Moderno",\n "Momento",\n "Nazione",\n "Nessuno",\n "Normale",\n "Notizia",\n "Oggetto",\n "Operaio",\n "Origine",\n "Padrone",\n "Palazzo",\n "Partito",\n "Passato",\n "Periodo",\n "Persona",\n "Piacere",\n "Pianura",\n "Piccolo",\n "Polizia",\n "Potenza",\n "Preciso",\n "Privato",\n "Proprio",\n "Qualche",\n "Ragazza",\n "Ragazzo",\n "Ragione",\n "Realt�",\n "Recente",\n "Regione",\n "Ricerca",\n "Ricordo",\n "Ritorno",\n "Scienza",\n "Secondo",\n "Segreto",\n "Seguito",\n "Sguardo",\n "Signora",\n "Signore",\n "Sistema",\n "Sociale",\n "Soldato",\n "Sorella",\n "Sorriso",\n "Sottile",\n "Spirito",\n "Storico",\n "Stupido",\n "Tecnico",\n "Tedesco",\n "Termine",\n "Terreno",\n "Ufficio",\n "Vecchio",\n "Verit�",\n "Vestito",\n "Viaggio",\n "Ambiente",\n "Articolo",\n "Assoluto",\n "Avvocato",\n "Bellezza",\n "Campagna",\n "Centrale",\n "Ciascuno",\n "Civilt�",\n "Compagno",\n "Concetto",\n "Contatto",\n "Contento",\n "Continuo",\n "Coraggio",\n "Corrente",\n "Discorso",\n "Distanza",\n "Domenica",\n "Elemento",\n "Esercito",\n "Fabbrica",\n "Famiglia",\n "Fantasia",\n "Fenomeno",\n "Finestra",\n "Francese",\n "Fratello",\n "Funzione",\n "Generale",\n "Generale",\n "Giardino",\n "Giornale",\n "Giornata",\n "Giudizio",\n "Immagine",\n "Istituto",\n "Italiano",\n "Libert�",\n "Macchina",\n "Maggiore",\n "Malattia",\n "Medesimo",\n "Mestiere",\n "Migliore",\n "Militare",\n "Ministro",\n "Montagna",\n "Naturale",\n "Notevole",\n "Numeroso",\n "Opinione",\n "Orecchio",\n "Ospedale",\n "Passione",\n "Pensiero",\n "Perfetto",\n "Pericolo",\n "Politica",\n "Politico",\n "Presente",\n "Presenza",\n "Principe",\n "Problema",\n "Processo",\n "Prodotto",\n "Profondo",\n "Proposta",\n "Prossimo",\n "Pubblico",\n "Pubblico",\n "Qualit�",\n "Rapporto",\n "Rispetto",\n "Risposta",\n "Semplice",\n "Servizio",\n "Silenzio",\n "Sinistro",\n "Societ�",\n "Speciale",\n "Speranza",\n "Stagione",\n "Stazione",\n "Successo",\n "Sviluppo",\n "Volont�",\n "Americano",\n "Argomento",\n "Attivit�",\n "Autorit�",\n "Battaglia",\n "Carattere",\n "Cattolico",\n "Cittadino",\n "Commercio",\n "Compagnia",\n "Confronto",\n "Congresso",\n "Consiglio",\n "Contadino",\n "Contrario",\n "Controllo",\n "Coscienza",\n "Cristiano",\n "Decisione",\n "Desiderio",\n "Difficile",\n "Direttore",\n "Direzione",\n "Economico",\n "Elettrico",\n "Giustizia",\n "Industria",\n "Interesse",\n "Movimento",\n "Nazionale",\n "Occasione",\n "Parecchio",\n "Personale",\n "Posizione",\n "Possibile",\n "Pricipale",\n "Principio",\n "Programma",\n "Proposito",\n "Provincia",\n "Qualsiasi",\n "Qualunque",\n "Questione",\n "Relazione",\n "Religioso",\n "Ricchezza",\n "Risultato",\n "Scrittore",\n "Settimana",\n "Sicurezza",\n "Signorina",\n "Soluzione",\n "Straniero",\n "Strumento",\n "Superiore",\n "Ufficiale",\n "Ufficiale",\n "Attenzione",\n "Automobile",\n "Chilometro",\n "Condizione",\n "Conoscenza",\n "Differenza",\n "Eccellenza",\n "Esperienza",\n "Giovanotto",\n "Importante",\n "Importanza",\n "Improvviso",\n "Intenzione",\n "Matrimonio",\n "Necessario",\n "Necessit�",\n "Operazione",\n "Pericoloso",\n "Pomeriggio",\n "Presidente",\n "Produzione",\n "Professore",\n "Repubblica",\n "Sacrificio",\n "Segretario",\n "Sentimento",\n "Situazione",\n "Spettacolo",\n "Territorio",\n "Tranquillo",\n "Commissione",\n "Conseguenza",\n "Costruzione",\n "Difficolt�",\n "Espressione",\n "Impossibile",\n "Impressione",\n "Industriale",\n "Particolare",\n "Personaggio",\n "Popolazione",\n "Rivoluzione",\n "Universit�",\n "Disposizione",\n "Interessante",\n "Possibilit�",\n "Atteggiamento",\n "Comunicazione",\n "Straordinario",\n "Caratteristico",\n "Internazionale"\n ],\n "lover": [\n "Lover",\n "Aficionado",\n "Liker",\n "Beloved",\n "Admirer",\n "Boyfriend",\n "Girlfriend",\n "Companion",\n "Suitor",\n "Sweetheart",\n "Beau",\n "Darling",\n "Dearest",\n "Valentine",\n "Swain",\n "Courter",\n "Fiance",\n "Fiancei",\n "Superfan"\n ],\n "meat": [\n "Meat",\n "Veggie",\n "Cheese"\n ],\n "price": [\n "5",\n "6",\n "7",\n "8",\n "9",\n "10",\n "11",\n "12",\n "13",\n "14",\n "15",\n "16",\n "17",\n "18",\n "19",\n "20"\n ],\n "endprice": [\n ".00",\n ".25",\n ".50",\n ".75"\n ],\n "fullprice": [\n "$#price##endprice#"\n ]\n}
v.2016-09-05
//requires jquery\n\n// input: an array of objects\n//\t\t a property that each of those object have\n// output: an array of the properties of all the objects\nwindow.skimObjectArray = function(objectArray, property){\n\tconsole.log("skimObjectArray(", "objectArray", objectArray, "property", property, ")")\n\tvar values = [];\n\n\tfor (var i = 0; i < objectArray.length; i++) {\n\t\tvar thingToAdd = objectArray[i][property];\n\t\tif(typeof thingToAdd === "object"){\n\t\t\t// i hope to god this works\n\t\t\tthingToAdd = objectArray[i][property].join("\sn")\n\t\t}\n\t\tvalues.push( thingToAdd );\n\t};\n\n\tvalues = values.join("\sn");\n\tvalues = values.split("\sn")\n\n\treturn values;\n}\n\nStory.prototype.appendCorpora = function(){\n\tvar corporaToAppend = tale.lookup("tags", "corpus");\n\tif(!corporaToAppend.length) return;\n\n\tfor(var i in corporaToAppend){\n\t\tvar currentPassage = corporaToAppend[i].title;\n\n\t\t// the rules are the concatenation of each symbol in this passage\n\t\tvar rules = [];\n\t\tvar lines = tale.passages[currentPassage].text.split("\sn")\n\t\tfor(var j in lines){\n\t\t\tvar line = lines[j];\n\t\t\tvar location = line.split("#");\n\t\t\tconsole.log("location: ", location);\n\t\t\tvar corpusLocation = location[0];\n\n\t\t\t// fetch me that sweet sweet boy\n\t\t\tvar corpus = $.ajax({\n\t\t\t\tdataType: "json",\n\t\t\t\turl: corpusLocation,\n\t\t\t\tasync: false\n\t\t\t});\n\t\t\tcorpus = corpus.responseJSON;\n\n\t\t\t// drill down to the array we want\n\t\t\tfor (var i = 1; i < location.length; i++) {\n\t\t\t\tconsole.log("corpus: ", corpus);\n\t\t\t\t// if there's a ! at the beginning of a location, skim the objArray for that property\n\t\t\t\tif(location[i][0] === "!"){\n\t\t\t\t\tcorpus = skimObjectArray(corpus, location[i].substring(1));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcorpus = corpus[ location[i] ]\n\t\t\t};\n\n\t\t\tconsole.log("corpus: ", corpus);\n\t\t\t// add this into the symbol-in-progress\n\t\t\trules = rules.concat(corpus);\n\t\t\tconsole.log("rules: ", rules)\n\t\t}\n\n\t\t// the name of this symbol is the name of the passage\n\t\tvar finalJSON = "{ \s"" + currentPassage + "\s": " + JSON.stringify(rules) + " }";\n\n\t\t// save our dark deeds to the passage\n\t\ttale.passages[currentPassage].text = finalJSON;\n\n\t\t//tag this as JSON so it gets appended in the next step\n\t\ttale.passages[currentPassage].tags.push("JSON")\n\t}\n\n\tconsole.log("corpora loaded")\n}\n\nStory.prototype.appendJSON = function() {\n\tvar JSONtoAppend = tale.lookup("tags", "JSON");\n\tif(!JSONtoAppend.length) return;\n\n\tfor(i in JSONtoAppend){\n\t\tvar newJSON = JSON.parse(JSONtoAppend[i].text);\n\t\t$.extend(this.data, newJSON);\n\t}\n\tconsole.log("JSON appended");\n}\n\nfunction Story(){\n\tvar grammars = tale.lookup("tags", "grammar", "title");\n\tthis.data = {};\n\n\tvar links = /(\s[\s[\sb)(.+?)(\sb\s]\s])/g;\n\tvar sublinks = /([^\s[\s]]+)*(.+)/\n\n\tfunction convertSyntax(match, p1, p2, p3){\n\t\t// If a passage is invoked that's tagged as a grammar, change Twine links into Tracery symbols.\n\t\t// e.g.: [[animal]] => #animal#\n\t\t// e.g.: [[animal][capitalize]] => #animal.capitalize#\n\n\t\t// p1 is left brackets, p3 is right brackets\n\t\tvar targetLink = p2.split("][")[0];\n\t\tvar modifiers = p2.split("][").slice(1, p2.length).join(".");\n\t\tmodifiers = modifiers?("." + modifiers):"";\n\t\t\n\t\tvar trace = "#" + targetLink + modifiers + "#";\n\t\t\n\t\tvar linkIsGrammar = false;\n\t\tvar tags = tale.get(targetLink).tags\n\t\tfor(var i = 0; i < tags.length; i++){\n\t\t\tif(tags[i] == "grammar" || tags[i] == "corpus"){\n\t\t\t\tlinkIsGrammar = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn linkIsGrammar?trace:match;\n\t}\n\n\tfor(var i in grammars){\n\t\tif(grammars[i] == undefined) continue;\n\n\t\t// Passage names become grammar names, Passage text becomes grammar text. \n\t\tvar newSymbol = grammars[i].title\n\t\tvar newText = grammars[i].text\n\n\t\tvar link = /(\s[\s[\sb)(.+?)(\sb\s]\s])/g;\n\t\tnewText = newText.replace(link, convertSyntax);\n\t\t// Get everything that's being linked to.\n\n\t\tthis.data[newSymbol] = newText.split('\sn');\n\t}\n\n\tthis.appendCorpora();\n\tthis.appendJSON();\n\tconsole.log("Story: ", this);\n}\nStory.prototype.constructor = Story;\n\n// Append this to the tale object because I don't know where else to put it.\nTale.prototype.story = new Story();\n\nStory.prototype.toHTML = function() {\n\tvar output = [];\n\tvar tab = " ";\n\tvar beg = '\sn' + tab + "\s"<span class=\s"grammarContents\s">{{{"\n\tvar end = "}}}</span>\s""\n\n\tfor(var i in this.data){\n\t\tvar gram = "<span class=\s"grammarTitle\s">\s"" + i + "\s"</span>: [";\n\t\tgram += beg + this.data[i].join(end + ',' + beg) + end;\n\t\tgram += "]";\n\t\toutput.push(gram);\n\t}\n\treturn "{\sn" + output.join(",\sn") + "\sn}";\n}\n\nTale.prototype.JSONtoTwee = function() {\n\tvar JSONtoConvert = tale.lookup("tags", "JSON");\n\tvar combinedJSON = ""\n\n\tfor (var i in JSONtoConvert){\n\t\tcombinedJSON += JSONtoConvert[i].text;\n\t}\n\n\t// Note the {{{}}} delimiters in textPost. This is intended for display in Twine, so\n\t// if you're just running these raw they aren't necessary.\n\tvar regex = {titlesPre: /\st"(.+)": \s[/g, titlesPost: "<br>:: $1 [grammar]",\n\t\t\t\t textPre: /\st*"(.+)",*(?:\sn\st)?(?:\s],)*\sn/g, textPost: "{{{$1}}}<br>"}\n\n\tvar tweeOutput = combinedJSON.replace(regex.titlesPre, regex.titlesPost);\n\ttweeOutput = tweeOutput.replace(regex.textPre, regex.textPost);\n\ttweeOutput = tweeOutput.replace(/({\sn)|(]\sn})/g, "")\n\n\treturn tweeOutput;\n}
window.tracery = {\n utilities : {}\n};\n\n(function () {/**\n * @author Kate Compton\n */\n\nfunction inQuotes(s) {\n return '"' + s + '"';\n};\n\nfunction parseAction(action) {\n return action;\n};\n\n// tag format\n// a thing to expand, plus actions\n\nfunction parseTag(tag) {\n var errors = [];\n var prefxns = [];\n var postfxns = [];\n\n var lvl = 0;\n var start = 0;\n\n var inPre = true;\n\n var symbol,\n mods;\n\n function nonAction(end) {\n if (start !== end) {\n var section = tag.substring(start, end);\n if (!inPre) {\n errors.push("multiple possible expansion symbols in tag!" + tag);\n } else {\n inPre = false;\n var split = section.split(".");\n symbol = split[0];\n mods = split.slice(1, split.length);\n }\n\n }\n start = end;\n };\n\n for (var i = 0; i < tag.length; i++) {\n var c = tag.charAt(i);\n\n switch(c) {\n case '[':\n if (lvl === 0) {\n nonAction(i);\n }\n\n lvl++;\n break;\n case ']':\n lvl--;\n if (lvl === 0) {\n var section = tag.substring(start + 1, i);\n if (inPre)\n prefxns.push(parseAction(section));\n else\n postfxns.push(parseAction(section));\n start = i + 1;\n }\n break;\n\n default:\n if (lvl === 0) {\n\n }\n break;\n\n }\n }\n nonAction(i);\n\n if (lvl > 0) {\n var error = "Too many '[' in rule " + inQuotes(tag);\n errors.push(error);\n\n }\n\n if (lvl < 0) {\n var error = "Too many ']' in rule " + inQuotes(tag);\n errors.push(error);\n\n }\n\n return {\n preActions : prefxns,\n postActions : postfxns,\n symbol : symbol,\n mods : mods,\n raw : tag,\n errors : errors,\n };\n};\n\n// Split a rule into sections\nfunction parseRule(rule) {\n var sections = [];\n var errors = [];\n if (!( typeof rule == 'string' || rule instanceof String)) {\n errors.push("Cannot parse non-string rule " + rule);\n sections.errors = errors;\n return sections;\n }\n\n if (rule.length === 0) {\n return [];\n }\n\n var lvl = 0;\n var start = 0;\n var inTag = false;\n\n function createSection(end) {\n var section = rule.substring(start, end);\n if (section.length > 0) {\n if (inTag)\n sections.push(parseTag(section));\n else\n sections.push(section);\n }\n inTag = !inTag;\n start = end + 1;\n\n }\n\n for (var i = 0; i < rule.length; i++) {\n var c = rule.charAt(i);\n\n switch(c) {\n case '[':\n lvl++;\n break;\n case ']':\n lvl--;\n break;\n case '#':\n if (lvl === 0) {\n createSection(i);\n }\n break;\n default:\n break;\n\n }\n\n }\n\n if (lvl > 0) {\n var error = "Too many '[' in rule " + inQuotes(rule);\n errors.push(error);\n\n }\n\n if (lvl < 0) {\n var error = "Too many ']' in rule " + inQuotes(rule);\n errors.push(error);\n\n }\n\n if (inTag) {\n var error = "Odd number of '#' in rule " + inQuotes(rule);\n errors.push(error);\n }\n\n createSection(rule.length);\n sections.errors = errors;\n return sections;\n};\n\nfunction testParse(rule, shouldFail) {\n console.log("-------");\n console.log("Test parse rule: " + inQuotes(rule) + " " + shouldFail);\n var parsed = parseRule(rule);\n if (parsed.errors && parsed.errors.length > 0) {\n for (var i = 0; i < parsed.errors.length; i++) {\n console.log(parsed.errors[i]);\n }\n }\n \n\n}\n\nfunction testParseTag(tag, shouldFail) {\n console.log("-------");\n console.log("Test parse tag: " + inQuotes(tag) + " " + shouldFail);\n var parsed = parseTag(tag);\n if (parsed.errors && parsed.errors.length > 0) {\n for (var i = 0; i < parsed.errors.length; i++) {\n console.log(parsed.errors[i]);\n }\n }\n}\n\ntracery.testParse = testParse;\ntracery.testParseTag = testParseTag;\ntracery.parseRule = parseRule;\ntracery.parseTag = parseTag;\n\n\nfunction spacer(size) {\n var s = "";\n for (var i = 0; i < size * 3; i++) {\n s += " ";\n }\n return s;\n}\n\n/* Simple JavaScript Inheritance\n * By John Resig http://ejohn.org/\n * MIT Licensed.\n */\n\nfunction extend(destination, source) {\n for (var k in source) {\n if (source.hasOwnProperty(k)) {\n destination[k] = source[k];\n }\n }\n return destination;\n}\n\n// Inspired by base2 and Prototype\n(function() {\n var initializing = false,\n fnTest = /xyz/.test(function() { xyz;\n }) ? /\sb_super\sb/ : /.*/;\n\n // The base Class implementation (does nothing)\n this.Class = function() {\n };\n\n // Create a new Class that inherits from this class\n Class.extend = function(prop) {\n var _super = this.prototype;\n\n // Instantiate a base class (but only create the instance,\n // don't run the init constructor)\n initializing = true;\n var prototype = new this();\n initializing = false;\n\n // Copy the properties over onto the new prototype\n for (var name in prop) {\n // Check if we're overwriting an existing function\n prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn) {\n return function() {\n var tmp = this._super;\n\n // Add a new ._super() method that is the same method\n // but on the super-class\n this._super = _super[name];\n\n // The method only need to be bound temporarily, so we\n // remove it when we're done executing\n var ret = fn.apply(this, arguments);\n this._super = tmp;\n\n return ret;\n };\n })(name, prop[name]) : prop[name];\n }\n\n // The dummy class constructor\n function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }\n\n // Populate our constructed prototype object\n Class.prototype = prototype;\n\n // Enforce the constructor to be what we expect\n Class.prototype.constructor = Class;\n\n // And make this class extendable\n Class.extend = arguments.callee;\n\n return Class;\n };\n})();\n\n/**\n * @author Kate\n */\n\nvar Rule = function(raw) {\n this.raw = raw;\n this.sections = parseRule(raw);\n\n};\n\nRule.prototype.getParsed = function() {\n if (!this.sections)\n this.sections = parseRule(raw);\n\n return this.sections;\n};\n\nRule.prototype.toString = function() {\n return this.raw;\n};\n\nRule.prototype.toJSONString = function() {\n return this.raw;\n};\n\n/**\n * @author Kate\n */\n\nvar RuleWeighting = Object.freeze({\n RED : 0,\n GREEN : 1,\n BLUE : 2\n});\n\nvar RuleSet = function(rules) {\n // is the rules obj an array? A RuleSet, or a string?\n if (rules.constructor === Array) {\n // make a copy\n rules = rules.slice(0, rules.length);\n } else if (rules.prototype === RuleSet) {\n // clone\n } else if ( typeof rules == 'string' || rules instanceof String) {\n var args = Array.prototype.slice.call(arguments);\n rules = args;\n } else {\n console.log(rules);\n throw ("creating ruleset with unknown object type!");\n }\n\n // create rules and their use counts\n\n this.rules = rules;\n this.parseAll();\n\n this.uses = [];\n this.startUses = [];\n this.totalUses = 0;\n for (var i = 0; i < this.rules.length; i++) {\n this.uses[i] = 0;\n this.startUses[i] = this.uses[i];\n this.totalUses += this.uses[i];\n }\n\n};\n\n//========================================================\n// Iterating over rules\n\nRuleSet.prototype.parseAll = function(fxn) {\n for (var i = 0; i < this.rules.length; i++) {\n if (this.rules[i].prototype !== Rule)\n this.rules[i] = new Rule(this.rules[i]);\n }\n\n};\n\n//========================================================\n// Iterating over rules\n\nRuleSet.prototype.mapRules = function(fxn) {\n return this.rules.map(function(rule, index) {\n return fxn(rule, index);\n });\n};\n\nRuleSet.prototype.applyToRules = function(fxn) {\n for (var i = 0; i < this.rules.length; i++) {\n fxn(this.rules[i], i);\n }\n};\n//========================================================\nRuleSet.prototype.get = function() {\n var index = this.getIndex();\n\n return this.rules[index];\n};\n\nRuleSet.prototype.getRandomIndex = function() {\n return Math.floor(this.uses.length * Math.random());\n};\n\nRuleSet.prototype.getIndex = function() {\n // Weighted distribution\n // Imagine a bar of length 1, how to divide the length\n // s.t. a random dist will result in the dist we want?\n\n var index = this.getRandomIndex();\n // What if the uses determine the chance of rerolling?\n\n var median = this.totalUses / this.uses.length;\n\n var count = 0;\n while (this.uses[index] > median && count < 20) {\n index = this.getRandomIndex();\n count++;\n }\n\n // reroll more likely if index is too much higher\n\n return index;\n};\n\nRuleSet.prototype.decayUses = function(pct) {\n this.totalUses = 0;\n for (var i = 0; i < this.uses; i++) {\n\n this.uses[index] *= 1 - pct;\n this.totalUses += this.uses[index];\n }\n};\n\nRuleSet.prototype.testRandom = function() {\n console.log("Test random");\n var counts = [];\n for (var i = 0; i < this.uses.length; i++) {\n counts[i] = 0;\n }\n\n var testCount = 10 * this.uses.length;\n for (var i = 0; i < testCount; i++) {\n\n var index = this.getIndex();\n this.uses[index] += 1;\n\n counts[index]++;\n this.decayUses(.1);\n }\n\n for (var i = 0; i < this.uses.length; i++) {\n console.log(i + ":\st" + counts[i] + " \st" + this.uses[i]);\n }\n};\n\nRuleSet.prototype.getSaveRules = function() {\n var jsonRules = this.rules.map(function(rule) {\n return rule.toJSONString();\n });\n\n return jsonRules;\n};\n\n/**\n * @author Kate Compton\n */\n\nvar Action = function(node, raw) {\n\n this.node = node;\n this.grammar = node.grammar;\n this.raw = raw;\n\n};\n\nAction.prototype.activate = function() {\n\n var node = this.node;\n node.actions.push(this);\n\n // replace any hashtags\n this.amended = this.grammar.flatten(this.raw);\n\n var parsed = parseTag(this.amended);\n var subActionRaw = parsed.preActions;\n if (subActionRaw && subActionRaw.length > 0) {\n this.subactions = subActionRaw.map(function(action) {\n return new Action(node, action);\n });\n\n }\n\n if (parsed.symbol) {\n var split = parsed.symbol.split(":");\n\n if (split.length === 2) {\n this.push = {\n symbol : split[0],\n\n // split into multiple rules\n rules : split[1].split(","),\n };\n // push\n node.grammar.pushRules(this.push.symbol, this.push.rules);\n\n } else\n throw ("Unknown action: " + parsed.symbol);\n }\n\n if (this.subactions) {\n for (var i = 0; i < this.subactions.length; i++) {\n this.subactions[i].activate();\n }\n }\n\n};\n\nAction.prototype.deactivate = function() {\n if (this.subactions) {\n for (var i = 0; i < this.subactions.length; i++) {\n this.subactions[i].deactivate();\n }\n }\n\n if (this.push) {\n this.node.grammar.popRules(this.push.symbol, this.push.rules);\n }\n};\n\n/**\n * @author Kate Compton\n */\n\nvar isConsonant = function(c) {\n c = c.toLowerCase();\n switch(c) {\n case 'a':\n return false;\n case 'e':\n return false;\n case 'i':\n return false;\n case 'o':\n return false;\n case 'u':\n return false;\n\n }\n return true;\n};\n\nfunction endsWithConY(s) {\n if (s.charAt(s.length - 1) === 'y') {\n return isConsonant(s.charAt(s.length - 2));\n }\n return false;\n};\n\nvar universalModifiers = {\n capitalizeAll : function(s) {\n return s.replace(/(?:^|\ss)\sS/g, function(a) {\n return a.toUpperCase();\n });\n\n },\n\n capitalize : function(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n\n },\n\n inQuotes : function(s) {\n return '"' + s + '"';\n },\n\n comma : function(s) {\n var last = s.charAt(s.length - 1);\n if (last === ",")\n return s;\n if (last === ".")\n return s;\n if (last === "?")\n return s;\n if (last === "!")\n return s;\n return s + ",";\n },\n\n beeSpeak : function(s) {\n // s = s.replace("s", "zzz");\n\n s = s.replace(/s/, 'zzz');\n return s;\n },\n\n a : function(s) {\n if (!isConsonant(s.charAt()))\n return "an " + s;\n return "a " + s;\n\n },\n\n s : function(s) {\n\n var last = s.charAt(s.length - 1);\n\n switch(last) {\n case 'y':\n\n // rays, convoys\n if (!isConsonant(s.charAt(s.length - 2))) {\n return s + "s";\n }\n // harpies, cries\n else {\n return s.slice(0, s.length - 1) + "ies";\n }\n break;\n\n // oxen, boxen, foxen\n case 'x':\n return s.slice(0, s.length - 1) + "en";\n case 'z':\n return s.slice(0, s.length - 1) + "es";\n case 'h':\n return s.slice(0, s.length - 1) + "es";\n\n default:\n return s + "s";\n };\n\n },\n\n ed : function(s) {\n\n var index = s.indexOf(" ");\n var s = s;\n var rest = "";\n if (index > 0) {\n rest = s.substring(index, s.length);\n s = s.substring(0, index);\n\n }\n\n var last = s.charAt(s.length - 1);\n\n switch(last) {\n case 'y':\n\n // rays, convoys\n if (isConsonant(s.charAt(s.length - 2))) {\n return s.slice(0, s.length - 1) + "ied" + rest;\n\n }\n // harpies, cries\n else {\n return s + "ed" + rest;\n }\n break;\n case 'e':\n return s + "d" + rest;\n\n break;\n\n default:\n return s + "ed" + rest;\n };\n }\n};\n/**\n * @author Kate Compton\n */\n\n// A tracery expansion node\nvar nodeCount = 0;\n\nvar ExpansionNode = Class.extend({\n init : function() {\n this.depth = 0;\n this.id = nodeCount;\n nodeCount++;\n this.childText = "[[UNEXPANDED]]";\n },\n\n setParent : function(parent) {\n if (parent) {\n this.depth = parent.depth + 1;\n this.parent = parent;\n this.grammar = parent.grammar;\n }\n },\n\n expand : function() {\n // do nothing\n return "???";\n },\n\n expandChildren : function() {\n\n if (this.children) {\n this.childText = "";\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].expand();\n this.childText += this.children[i].finalText;\n }\n this.finalText = this.childText;\n }\n\n },\n\n createChildrenFromSections : function(sections) {\n var root = this;\n this.children = sections.map(function(section) {\n\n if ( typeof section == 'string' || section instanceof String) {\n // Plaintext\n return new TextNode(root, section);\n } else {\n return new TagNode(root, section);\n }\n });\n }\n});\n\nvar RootNode = ExpansionNode.extend({\n init : function(grammar, rawRule) {\n this._super();\n this.grammar = grammar;\n this.parsedRule = parseRule(rawRule);\n },\n\n expand : function() {\n var root = this;\n this.createChildrenFromSections(this.parsedRule);\n\n // expand the children\n this.expandChildren();\n },\n});\n\nvar TagNode = ExpansionNode.extend({\n init : function(parent, parsedTag) {\n this._super();\n\n if (!(parsedTag !== null && typeof parsedTag === 'object')) {\n if ( typeof parsedTag == 'string' || parsedTag instanceof String) {\n console.warn("Can't make tagNode from unparsed string!");\n parsedTag = parseTag(parsedTag);\n\n } else {\n console.log("Unknown tagNode input: ", parsedTag);\n throw ("Can't make tagNode from strange tag!");\n\n }\n }\n\n this.setParent(parent);\n $.extend(this, parsedTag);\n },\n\n expand : function() {\n if (tracery.outputExpansionTrace)\n console.log(r.sections);\n\n this.rule = this.grammar.getRule(this.symbol);\n\n this.actions = [];\n\n // Parse the rule if it hasn't been already\n this.createChildrenFromSections(this.rule.getParsed());\n\n // Do any pre-expansion actions!\n for (var i = 0; i < this.preActions.length; i++) {\n var action = new Action(this, this.preActions[i]);\n action.activate();\n }\n\n // Map each child section to a node\n if (!this.rule.sections)\n console.log(this.rule);\n\n this.expandChildren();\n\n for (var i = 0; i < this.actions.length; i++) {\n\n this.actions[i].deactivate();\n }\n\n this.finalText = this.childText;\n for (var i = 0; i < this.mods.length; i++) {\n this.finalText = this.grammar.applyMod(this.mods[i], this.finalText);\n }\n\n },\n\n toLabel : function() {\n return this.symbol;\n },\n toString : function() {\n return "TagNode '" + this.symbol + "' mods:" + this.mods + ", preactions:" + this.preActions + ", postactions" + this.postActions;\n }\n});\n\nvar TextNode = ExpansionNode.extend({\n isLeaf : true,\n init : function(parent, text) {\n this._super();\n\n this.setParent(parent);\n\n this.text = text;\n\n this.finalText = text;\n },\n expand : function() {\n // do nothing\n },\n\n toLabel : function() {\n return this.text;\n }\n});\n\n/**\n * @author Kate Compton\n */\n\nfunction Symbol(grammar, key) {\n this.grammar = grammar;\n this.key = key;\n this.currentRules = undefined;\n this.ruleSets = [];\n\n};\n\nSymbol.prototype.loadFrom = function(rules) {\n\n rules = this.wrapRules(rules);\n this.baseRules = rules;\n\n this.ruleSets.push(rules);\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n\n};\n\n//========================================================\n// Iterating over rules\n\nSymbol.prototype.mapRules = function(fxn) {\n\n return this.currentRules.mapRules(fxn);\n};\n\nSymbol.prototype.applyToRules = function(fxn) {\n this.currentRules.applyToRules(fxn);\n};\n\n//==================================================\n// Rule pushpops\nSymbol.prototype.wrapRules = function(rules) {\n if (rules.prototype !== RuleSet) {\n if (Array.isArray(rules)) {\n return new RuleSet(rules);\n } else if ( typeof rules == 'string' || rules instanceof String) {\n return new RuleSet(rules);\n } else {\n throw ("Unknown rules type: " + rules);\n }\n }\n // already a ruleset\n return rules;\n};\n\nSymbol.prototype.pushRules = function(rules) {\n rules = this.wrapRules(rules);\n this.ruleSets.push(rules);\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n};\n\nSymbol.prototype.popRules = function() {\n var exRules = this.ruleSets.pop();\n\n if (this.ruleSets.length === 0) {\n //console.warn("No more rules for " + this + "!");\n }\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n};\n\n// Clear everything and set the rules\nSymbol.prototype.setRules = function(rules) {\n\n rules = this.wrapRules(rules);\n this.ruleSets = [rules];\n this.currentRules = rules;\n\n};\n\nSymbol.prototype.addRule = function(rule) {\n this.currentRules.addRule(seed);\n};\n\n//========================================================\n// selection\n\nSymbol.prototype.select = function() {\n this.isSelected = true;\n\n};\n\nSymbol.prototype.deselect = function() {\n this.isSelected = false;\n};\n\n//==================================================\n// Getters\n\nSymbol.prototype.getRule = function(seed) {\n return this.currentRules.get(seed);\n};\n\n//==================================================\n\nSymbol.prototype.toString = function() {\n return this.key + ": " + this.currentRules + "(overlaying " + (this.ruleSets.length - 1) + ")";\n};\nSymbol.prototype.toJSON = function() {\n\n var rules = this.baseRules.rules.map(function(rule) {\n return '"' + rule.raw + '"';\n });\n return '"' + this.key + '"' + ": [" + rules.join(", ") + "]";\n};\n\nSymbol.prototype.toHTML = function(useSpans) {\n var keySpan = '"' + this.key + '"';\n if (useSpans)\n keySpan = "<span class='symbol symbol_" + this.key + "'>" + keySpan + "</span>";\n\n var rules = this.baseRules.rules.map(function(rule) {\n var s = '"' + rule.raw + '"';\n if (useSpans)\n s = "<span class='rule'>" + s + "</span>";\n return s;\n });\n return keySpan + ": [" + rules.join(", ") + "]";\n};\n\n/**\n * @author Kate Compton\n */\n\nfunction Grammar() {\n this.clear();\n};\n\nGrammar.prototype.clear = function() {\n // Symbol library\n this.symbols = {};\n \n this.errors = [];\n \n // Modifier library\n this.modifiers = {};\n\n // add the universal mods\n for (var mod in universalModifiers) {\n if (universalModifiers.hasOwnProperty(mod))\n this.modifiers[mod] = universalModifiers[mod];\n }\n};\n//========================================================\n// Loading\n\nGrammar.prototype.loadFrom = function(obj) {\n var symbolSrc;\n\n this.clear();\n\n if (obj.symbols !== undefined) {\n symbolSrc = obj.symbols;\n } else {\n symbolSrc = obj;\n }\n\n // get all json keys\n var keys = Object.keys(symbolSrc);\n\n this.symbolNames = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n this.symbolNames.push(key);\n\n this.symbols[key] = new Symbol(this, key);\n this.symbols[key].loadFrom(symbolSrc[key]);\n }\n\n};\n\nGrammar.prototype.toHTML = function(useSpans) {\n // get all json keys\n var keys = Object.keys(this.symbols);\n\n this.symbolNames = [];\n\n var lines = [];\n\n var count = 0;\n for (var i = 0; i < keys.length; i++) {\n\n var key = keys[i];\n var symbol = this.symbols[key];\n\n if (symbol && symbol.baseRules) {\n\n lines.push(" " + this.symbols[key].toHTML(useSpans));\n\n }\n };\n\n var s;\n s = lines.join(",</p><p>");\n s = "{<p>" + s + "</p>}";\n return s;\n};\n\nGrammar.prototype.toJSON = function() {\n // get all json keys\n var keys = Object.keys(this.symbols);\n\n this.symbolNames = [];\n\n var lines = [];\n\n var count = 0;\n for (var i = 0; i < keys.length; i++) {\n\n var key = keys[i];\n var symbol = this.symbols[key];\n\n if (symbol && symbol.baseRules) {\n\n lines.push(" " + this.symbols[key].toJSON());\n\n }\n };\n\n var s;\n s = lines.join(",\sn");\n s = "{\sn" + s + "\sn}";\n return s;\n};\n\n//========================================================\n// selection\n\nGrammar.prototype.select = function() {\n this.isSelected = true;\n};\n\nGrammar.prototype.deselect = function() {\n this.isSelected = false;\n};\n\n//========================================================\n// Iterating over symbols\n\nGrammar.prototype.mapSymbols = function(fxn) {\n var symbols = this.symbols;\n return this.symbolNames.map(function(name) {\n return fxn(symbols[name], name);\n });\n};\n\nGrammar.prototype.applyToSymbols = function(fxn) {\n for (var i = 0; i < this.symbolNames.length; i++) {\n var key = this.symbolNames[i];\n fxn(this.symbols[key], key);\n }\n};\n\n//========================================================\nGrammar.prototype.addOrGetSymbol = function(key) {\n if (this.symbols[key] === undefined)\n this.symbols[key] = new Symbol(key);\n\n return this.symbols[key];\n};\n\nGrammar.prototype.pushRules = function(key, rules) {\n var symbol = this.addOrGetSymbol(key);\n symbol.pushRules(rules);\n};\n\nGrammar.prototype.popRules = function(key, rules) {\n var symbol = this.addOrGetSymbol(key);\n var popped = symbol.popRules();\n\n if (symbol.ruleSets.length === 0) {\n // remove symbol\n this.symbols[key] = undefined;\n }\n};\n\nGrammar.prototype.applyMod = function(modName, text) {\n if (!this.modifiers[modName]) {\n console.log(this.modifiers);\n throw ("Unknown mod: " + modName);\n }\n return this.modifiers[modName](text);\n};\n\n//============================================================\nGrammar.prototype.getRule = function(key, seed) {\n var symbol = this.symbols[key];\n if (symbol === undefined) {\n var r = new Rule("{{" + key + "}}");\n\n r.error = "Missing symbol " + key;\n return r;\n }\n\n var rule = symbol.getRule();\n if (rule === undefined) {\n var r = new Rule("[" + key + "]");\n console.log(r.sections);\n r.error = "Symbol " + key + " has no rule";\n return r;\n }\n\n return rule;\n};\n\n//============================================================\n// Expansions\nGrammar.prototype.expand = function(raw) {\n\n // Start a new tree\n var root = new RootNode(this, raw);\n\n root.expand();\n\n return root;\n};\n\nGrammar.prototype.flatten = function(raw) {\n\n // Start a new tree\n var root = new RootNode(this, raw);\n\n root.expand();\n\n return root.childText;\n};\n\n//===============\n\nGrammar.prototype.analyze = function() {\n this.symbolNames = [];\n for (var name in this.symbols) {\n if (this.symbols.hasOwnProperty(name)) {\n this.symbolNames.push(name);\n }\n }\n\n // parse every rule\n\n for (var i = 0; i < this.symbolNames.length; i++) {\n var key = this.symbolNames[i];\n var symbol = this.symbols[key];\n // parse all\n for (var j = 0; j < symbol.baseRules.length; j++) {\n var rule = symbol.baseRules[j];\n rule.parsed = tracery.parse(rule.raw);\n // console.log(rule);\n\n }\n }\n\n};\n\nGrammar.prototype.selectSymbol = function(key) {\n console.log(this);\n var symbol = this.get(key);\n};\n/**\n * @author Kate Compton\n\n */\n\ntracery.createGrammar = function(obj) {\n var grammar = new Grammar();\n grammar.loadFrom(obj);\n return grammar;\n};\n\ntracery.test = function() {\n\n console.log("==========================================");\n console.log("test tracery");\n\n // good\n tracery.testParse("", false);\n tracery.testParse("fooo", false);\n tracery.testParse("####", false);\n tracery.testParse("#[]#[]##", false);\n tracery.testParse("#someSymbol# and #someOtherSymbol#", false);\n tracery.testParse("#someOtherSymbol.cap.pluralize#", false);\n tracery.testParse("#[#do some things#]symbol.mod[someotherthings[and a function]]#", false);\n tracery.testParse("#[fxn][fxn][fxn[subfxn]]symbol[[fxn]]#", false);\n tracery.testParse("#[fxn][#fxn#][fxn[#subfxn#]]symbol[[fxn]]#", false);\n tracery.testParse("#hero# ate some #color# #animal.s#", false);\n tracery.testParseTag("[action]symbol.mod1.mod2[postAction]", false);\n\n // bad\n tracery.testParse("#someSymbol# and #someOtherSymbol", true);\n tracery.testParse("#[fxn][fxn][fxn[subfxn]]symbol[fxn]]#", true);\n\n // bad\n tracery.testParseTag("stuff[action]symbol.mod1.mod2[postAction]", true);\n tracery.testParseTag("[action]symbol.mod1.mod2[postAction]stuff", true);\n\n tracery.testParse("#hero# ate some #color# #animal.s#", true);\n tracery.testParse("#[#setPronouns#][#setOccupation#][hero:#name#]story#", true);\n\n};\n \n})();
jquery:on\nhash:off\nbookmark:on\nmodernizr:off\nundo:on\nobfuscate:off\nexitprompt:off\nblankcss:off\n
<<silently>>\nUses the parameter if one was passed. Then, checks for the $symbol variable. If neither is present, uses "origin". Clears $symbol at the end.\n\n<<if parameter(0)>>\n\t<<set $symbol to parameter(0)>>\n<<else>><<if $symbol>>\n\tNo need to do anything.\n<<else>>\n\t<<set $symbol to "origin">>\n<<endif>><<endif>>\n\n<<endsilently>><<print console.log("trace " + $symbol)>><<print tale.grammar.flatten("#" + $symbol + "#")>><<forget $symbol>>
// Returns an array of traces, each different from the one preceding it unless retrace() maxes out attempts.\n\nwindow.traceArray = function(symbol, num){\n\tvar output = [];\n\toutput.push( trace(symbol) );\n\n\tfor (var i = 1; i < num; i++) {\n\t\toutput.push( retrace(symbol, output[i-1]) );\n\t};\n\n\treturn output;\n}
<<twineceryInit>>\n<<traceryInit>>
String.prototype.contains = function(substring){\n\tif (substring.constructor === Array){\n\t\tfor (var i = 0; i < substring.length; i++){\n\t\t\tif(this.contains(substring[i])){\n\t\t\t\treturn substring[i]; // Non-empty string evaluates to true\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\treturn this.indexOf(substring) > 0;\n\t}\n}
// Returns a new version of a given expansion.\nwindow.retrace = function(symbol, old, maxAttempts){\n\tif(maxAttempts === undefined){\n\t\tmaxAttempts = 32;\n\t}\n\tif(!(maxAttempts > 1)){\n\t\tmaxAttempts = 1;\n\t}\n\t\n\tvar output = "", attempts = 0;\n\tdo{\n\t\toutput = trace(symbol);\n\t\tattempts++;\n\t}while(output == old && attempts < maxAttempts)\n\n//\tconsole.log("retrace:"\n//\t\t\t\t+ "\sn\stold: " + old\n//\t\t\t\t+ "\sn\stnew: " + output\n//\t\t\t\t+ "\sn\stattempts: " + attempts)\n\treturn output;\n}
<<tracelink "origin">>\n
body {\n margin: 2%;\n}\n#passages{\n margin: 0;\n padding: 0;\n border: 0;\n width:96%;\n margin: auto;\n}\n.passage {\n font-size:6em; \n color: #888;\n text-shadow: #888 0 0 0.05em;\n}\n@media screen and (max-width: 960px) {\n .passage {\n font-size: 4em;\n }\n}\n@media screen and (max-width: 640px) {\n .passage {\n font-size: 3em;\n }\n}\na.internalLink, a.externalLink {\n color: #eee;\n text-shadow: #eee 0 0 0.07em;\n}\na.internalLink:hover, a.externalLink:hover {\n color: #fff;\n text-decoration: none;\n text-shadow: #fff 0 0 0.09em;\n}\n#sidebar {\n\tdisplay:none;\n}\nbody\n{\n background-color: #cc0000;\n}
window.grammar = function(rule){\n\treturn tale.get(rule).text.split('\sn');\n}
// Expands a symbol and returns the output.\nwindow.trace = function(symbol){\n\tif(symbol === undefined){\n\t\tsymbol = "origin";\n\t}\n\tif(tale.grammar === undefined){\n\t\tconsole.log("Couldn't find the grammar object.");\n\t\treturn "ERROR: Grammar object not found.";\n\t}\n\n\tvar output = tale.grammar.flatten("#" + symbol + "#")\t\n//\tconsole.log(symbol + " expands to:\sn" + output);\n\treturn output;\n}
// This is a slightly modified version of Leon Arnott's cyclinglink macro.\n\nversion.extensions.tracelinkMacro = {\n\tmajor: 0,\n\tminor: 1,\n\trevision: 0\n};\nmacros.tracelink = {\n\thandler: function(a, b, c) {\n\t\tvar rl = "traceLink";\n\n\t\tfunction toggleText(w) {\n\t\t\tw.classList.remove("traceLinkInit");\n\t\t\tw.classList.toggle(rl + "Enabled");\n\t\t\tw.classList.toggle(rl + "Disabled");\n\t\t\tw.style.display = ((w.style.display == "none") ? "inline" : "none")\n\t\t}\n\t\tswitch (c[c.length - 1]) {\n\t\t\tcase "end":\n\t\t\t\tvar end = true;\n\t\t\t\tc.pop();\n\t\t\t\tbreak;\n\t\t\tcase "out":\n\t\t\t\tvar out = true;\n\t\t\t\tc.pop();\n\t\t\t\tbreak\n\t\t}\n\t\tvar v = "";\n\t\tif (c.length && c[0][0] == "$") {\n\t\t\tv = c[0].slice(1);\n\t\t\tc.shift()\n\t\t}\n\t\tvar h = state.history[0].variables;\n\t\tif (out && h[v] === "") {\n\t\t\treturn\n\t\t}\n\t\tvar l = Wikifier.createInternalLink(a, null);\n\t\tl.className = "internalLink cyclingLink";\n\t\tl.setAttribute("data-cycle", 0);\n\n\t\t// Prebake a bunch of traces and use those as our links to cycle through.\n\t\tc = traceArray(c[0], 64);\n\n\t\tfor (var i = 0; i < c.length; i++) {\n\t\t\tvar on = (i == Math.max(c.indexOf(h[v]), 0));\n\t\t\tvar d = insertElement(null, "span", null, "traceLinkInit traceLink" + ((on) ? "En" : "Dis") + "abled");\n\t\t\tif (on) {\n\t\t\t\th[v] = c[i];\n\t\t\t\tl.setAttribute("data-cycle", i)\n\t\t\t} else {\n\t\t\t\td.style.display = "none"\n\t\t\t}\n\t\t\tinsertText(d, c[i]);\n\t\t\tif (on && end && i == c.length - 1) {\n\t\t\t\tl.parentNode.replaceChild(d, l)\n\t\t\t} else {\n\t\t\t\tl.appendChild(d)\n\t\t\t}\n\t\t}\n\t\tl.onclick = function() {\n\t\t\tvar t = this.childNodes;\n\t\t\tvar u = this.getAttribute("data-cycle") - 0;\n\t\t\tvar m = t.length;\n\t\t\ttoggleText(t[u]);\n\t\t\tu = (u + 1);\n\t\t\tif (!(out && u == m)) {\n\t\t\t\tu %= m;\n\t\t\t\tif (v) {\n\t\t\t\t\th[v] = c[u]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\th[v] = ""\n\t\t\t}\n\t\t\tif ((end || out) && u == m - (end ? 1 : 0)) {\n\t\t\t\tif (end) {\n\t\t\t\t\tvar n = this.removeChild(t[u]);\n\t\t\t\t\tn.className = rl + "End";\n\t\t\t\t\tn.style.display = "inline";\n\t\t\t\t\tthis.parentNode.replaceChild(n, this)\n\t\t\t\t} else {\n\t\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoggleText(t[u]);\n\t\t\tthis.setAttribute("data-cycle", u)\n\t\t}\n\t}\n};
Automata Pizzeria
Nora Reed with help from Vin Tanner
<<if !tale.grammar>>\n\t<<if tracery>>\n\t\t<<set tale.grammar = tracery.createGrammar(tale.story.data)>>\n\t\t<<print console.log("grammar: ", tale.grammar)>>\n\t<<else>>\n\t\t<<print console.log("grammar instantiation failed")>>\n\t<<endif>>\n<<endif>>