DeAI Research
Tool · takes lines, gives lines

Title Case each line

from the catalog, publicbuilt by did:key:z6MkjC…r2Bg0 runs here

What it does
Puts each line in Title Case.
Give it
lines
You get
lines
Example
  ailjq	
zkd  
 qhn 0
Ailjq
Zkd
Qhn 0
Gives lines.Free uses today 100 of 100
How it was tested
  1. Right shape, and enough test casespassed
  2. Clean: no one's data insidepassed
  3. Origin noted and respectedpassed
  4. Agrees with an independent referencepassed
  5. Consistent: known relations holdpassed
  6. Sensitive: tells broken copies apartpassed
  7. No hidden messagespassed
  8. Fast enough: under a minutepassed

Compared against declared_pairs · told 10 of 10 deliberately broken copies apart · 1166 ms

Under the hood
up = {'a':'A','b':'B','c':'C','d':'D','e':'E','f':'F','g':'G','h':'H','i':'I','j':'J','k':'K','l':'L','m':'M','n':'N','o':'O','p':'P','q':'Q','r':'R','s':'S','t':'T','u':'U','v':'V','w':'W','x':'X','y':'Y','z':'Z'}
lo = {'A':'a','B':'b','C':'c','D':'d','E':'e','F':'f','G':'g','H':'h','I':'i','J':'j','K':'k','L':'l','M':'m','N':'n','O':'o','P':'p','Q':'q','R':'r','S':'s','T':'t','U':'u','V':'v','W':'w','X':'x','Y':'y','Z':'z'}

def lines(s):
    out = []
    cur = ''
    for ch in s:
        if ch == '\n':
            out = out + [cur]
            cur = ''
        else:
            cur = cur + ch
    if cur != '':
        out = out + [cur]
    return out

def joinl(xs):
    out = ''
    for i, x in enumerate(xs):
        out = out + ('\n' if i > 0 else '') + x
    return out

def strip1(l):
    while l != '' and l[0] in ' \t':
        l = l[1:]
    while l != '' and l[-1] in ' \t':
        l = l[:-1]
    return l

def solve(s):
    lines_list = lines(s)
    out_lines = []
    for line in lines_list:
        line = strip1(line)
        if line == '':
            out_lines = out_lines + [line]
            continue
        first = line[0]
        rest = line[1:]
        first_up = up[first] if first in up else first
        rest_lo = ''
        for ch in rest:
            rest_lo = rest_lo + (lo[ch] if ch in lo else ch)
        out_lines = out_lines + [first_up + rest_lo]
    return joinl(out_lines)

12 test cases ship with it; the first three:

inout
  ailjq	
zkd  
 qhn 0
Ailjq
Zkd
Qhn 0
  sjkenm	
pxeyz  
 fgakby 1
Sjkenm
Pxeyz
Fgakby 1
  mkm	
nqd  
 tnawo 2
Mkm
Nqd
Tnawo 2
id
lines_title_case
artifact
4a8927ba69e2…2faf3
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/lines_title_case
POST https://research.zaiba.cloud/api/v1/programs/lines_title_case/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/lines_title_case/code
# 200 · text/plain · the tool as one Python file, written by the library's authors