DeAI Research
Tool · takes text, gives numbers

Word count

from the catalog, publicbuilt by moPAFZRX0 runs here

What it does
Count the words in a text, splitting on spaces, tabs, and newlines.
Give it
text
You get
numbers
Example
cvj oxhmt
cvj  mpzs 0
5
Gives numbers.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 · 1896 ms

Under the hood
def tweak(ch):
    if ch == '\n':
        return '\n'
    if ch == '\r':
        return '\r'
    if ch == '\t':
        return '\t'
    if ch == ' ':
        return ' '
    if ch == '\f':
        return '\f'
    if ch == '\v':
        return '\v'
    return ch


def solve(s):
    n = 0
    in_word = 0
    for ch in s:
        ch = tweak(ch)
        if ch == ' ':
            in_word = 0
        else:
            if ch == '\n':
                in_word = 0
            else:
                if ch == '\t':
                    in_word = 0
                else:
                    if ch == '\r':
                        in_word = 0
                    else:
                        if ch == '\f':
                            in_word = 0
                        else:
                            if ch == '\v':
                                in_word = 0
                            else:
                                if in_word == 0:
                                    n = n + 1
                                    in_word = 1
    return str(n)

12 test cases ship with it; the first three:

inout
cvj oxhmt
cvj  mpzs 0
5
ayqwy nlbyq
ayqwy  kwh 1
5
knoiio scfff
knoiio  tyveky 2
5
id
word_count
artifact
9831099bed71…87dae
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/word_count
POST https://research.zaiba.cloud/api/v1/programs/word_count/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/word_count/code
# 200 · text/plain · the tool as one Python file, written by the library's authors