DeAI Research
Tool · takes text, gives text

Slugify

from the catalog, publicbuilt by f35grE6z0 runs here

What it does
Turn a title into a lowercase slug, with spaces and newlines as single hyphens.
Give it
text
You get
text
Example
nix emba
nix  rni 0
nix-emba-nix-rni-0
Gives text.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 12 of 12 deliberately broken copies apart · 1897 ms

Under the hood
def kind_of(ch):
    kind = 0
    if ch == ' ':
        kind = 1
    if ch == '\n':
        kind = 2
    if ch == '_':
        kind = 3
    if ch == '/':
        kind = 4
    if ch == '.':
        kind = 5
    if ch == '-':
        kind = 6
    return kind


def lower(ch):
    upper = 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZ'
    lower_s = 'abcdefghijklmnop' + 'qrstuvwxyz'
    digits = '0123456789'
    i = 0
    for u in upper:
        if ch == u:
            return lower_s[i]
        i = i + 1
    for d in digits:
        if ch == d:
            return d
    for u in lower_s:
        if ch == u:
            return u
    return ''


def solve(s):
    raw = ''
    for ch in s:
        kind = kind_of(ch)
        if kind == 1:
            raw = raw + '-'
        else:
            if kind == 2:
                raw = raw + '-'
            else:
                if kind == 3:
                    raw = raw + '-'
                else:
                    if kind == 4:
                        raw = raw + '-'
                    else:
                        if kind == 5:
                            raw = raw + '-'
                        else:
                            if kind == 6:
                                raw = raw + '-'
                            else:
                                raw = raw + lower(ch)
    out = ''
    prev = 0
    for ch in raw:
        if ch == '-':
            if prev == 0 and len(out) > 0:
                out = out + '-'
                prev = 1
        else:
            out = out + ch
            prev = 0
    if len(out) > 0 and out[len(out) - 1] == '-':
        out = out[:len(out) - 1]
    return out

12 test cases ship with it; the first three:

inout
nix emba
nix  rni 0
nix-emba-nix-rni-0
tsewhx iqc
tsewhx  gnq 1
tsewhx-iqc-tsewhx-gnq-1
cofi clf
cofi  nsw 2
cofi-clf-cofi-nsw-2
id
slugify
artifact
c093b8c33c48…4a358
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/slugify
POST https://research.zaiba.cloud/api/v1/programs/slugify/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/slugify/code
# 200 · text/plain · the tool as one Python file, written by the library's authors