Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,4 @@
create or replace function tokenize(s) as (
regexp_split_to_array(s, ' *, *')
);
select tokenize('Hello,How,Are,You,Today') as tokens;

View file

@ -0,0 +1,15 @@
$ENTRY Go {
= <Prout <Join ('. ') <Split (',') 'Hello,How,Are,You,Today'>>>;
};
Split {
(e.S) = ;
(e.S) e.1 e.S e.2 = (e.1) <Split (e.S) e.2>;
(e.S) e.1 = (e.1);
};
Join {
(e.J) = ;
(e.J) (e.1) = e.1;
(e.J) (e.1) e.2 = e.1 e.J <Join (e.J) e.2>;
};

View file

@ -0,0 +1,18 @@
program tokenize_a_string;
s := 'Hello,How,Are,You,Today';
loop for part in tokenize(',', s) do
nprint(part + ". ");
end loop;
print;
proc tokenize(sep, s);
loop
init parts := [];
doing parts with:= break(s, sep);
while s /= ""
do
s := s(2..);
end loop;
return parts;
end proc;
end program;

View file

@ -0,0 +1,8 @@
\ clear explicit version
s =: "Hello,How,Are,You,Today"
r =: string s split by any of ',' \ single character split
print join r by '.'
\ all in one, no parenthesis required
print join string "Hello,How,Are,You,Today" split by any of ',' by '.'
\ parenthesis for clarity
print (join (string "Hello,How,Are,You,Today" split by any of ',') by '.')