Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
4
Task/Tokenize-a-string/DuckDB/tokenize-a-string.duckdb
Normal file
4
Task/Tokenize-a-string/DuckDB/tokenize-a-string.duckdb
Normal 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;
|
||||
15
Task/Tokenize-a-string/Refal/tokenize-a-string.refal
Normal file
15
Task/Tokenize-a-string/Refal/tokenize-a-string.refal
Normal 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>;
|
||||
};
|
||||
18
Task/Tokenize-a-string/SETL/tokenize-a-string.setl
Normal file
18
Task/Tokenize-a-string/SETL/tokenize-a-string.setl
Normal 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;
|
||||
8
Task/Tokenize-a-string/TAV/tokenize-a-string.tav
Normal file
8
Task/Tokenize-a-string/TAV/tokenize-a-string.tav
Normal 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 '.')
|
||||
Loading…
Add table
Add a link
Reference in a new issue