Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,35 @@
function findIn(%haystack,%needles)
{
%hc = getWordCount(%haystack);
%nc = getWordCount(%needles);
for(%i=0;%i<%nc;%i++)
{
%nword = getWord(%needles,%i);
%index[%nword] = -1;
}
for(%i=0;%i<%hc;%i++)
{
%hword = getWord(%haystack,%i);
for(%j=0;%j<%nc;%j++)
{
%nword = getWord(%needles,%j);
if(%hword $= %nword)
{
%index[%nword] = %i;
}
}
}
for(%i=0;%i<%nc;%i++)
{
%nword = getWord(%needles,%i);
%string = %string SPC %nword@"_"@%index[%nword];
%string = trim(%string);
}
return %string;
}

View file

@ -0,0 +1 @@
echo(findIn("Hello world, you are quite sunny today.","quite hello somethingelse"));

View file

@ -0,0 +1 @@
=> "quite_4 hello_0 somethingelse_-1"