{ "task": { "id": "case_35", "name": "token_capitalization_alternator", "summary": "Alternates capitalization of each character in words.", "examples": [ { "input": [ "BOS", "oCLrZaW", "V", "b", "oCLrZaW", "TPSI", "poiVg", "b", "b", "oCLrZaW" ], "output": [ "BOS", "OcLrZaW", "V", "B", "OcLrZaW", "TpSi", "PoIvG", "B", "B", "OcLrZaW" ] }, { "input": [ "BOS", "LB", "TPSI", "oCLrZaW", "TPSI", "TPSI", "poiVg", "b", "V", "poiVg" ], "output": [ "BOS", "Lb", "TpSi", "OcLrZaW", "TpSi", "TpSi", "PoIvG", "B", "V", "PoIvG" ] }, { "input": [ "BOS", "poiVg", "TPSI", "no", "b", "LB", "poiVg", "V", "no", "no" ], "output": [ "BOS", "PoIvG", "TpSi", "No", "B", "Lb", "PoIvG", "V", "No", "No" ] }, { "input": [ "BOS", "V", "J", "J", "TPSI", "TPSI", "oCLrZaW", "LB", "poiVg", "V" ], "output": [ "BOS", "V", "J", "J", "TpSi", "TpSi", "OcLrZaW", "Lb", "PoIvG", "V" ] }, { "input": [ "BOS", "LB", "poiVg", "V", "b", "J", "V", "LB", "no", "b" ], "output": [ "BOS", "Lb", "PoIvG", "V", "B", "J", "V", "Lb", "No", "B" ] } ], "is_categorical": true }, "program": "def alternate_capitalization(word):\n return ''.join(c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(word))\n\nalternator = rasp.Map(alternate_capitalization, sop)\nreturn alternator", "components": [ { "id": "L0_MLP", "hook": "blocks.0.mlp.hook_post", "role": { "tag": "MAPPER", "note": "Transforms each token independently by applying a consistent per-character formatting rule." }, "rasp_vars": [ "alternator" ], "labels": [ "map_1" ] } ] }