Discuss Scratch

ajskateboarder
Scratcher
1000+ posts

Text similarity

cookieclickerer33 wrote:

If we want diffrent letters then it should be a drop-down with “same” and “diffrent”
I do like having less blocks. Thanks again
Id somewhat prefer
(Closest to [text] in [list v]
Because then you could Itterate it by removing the item and rerunning it and whatnot while also looking cleaner
Might be confusing to have a single reporter that returns an iterator when nearly every other list-related reporters don't return them I want to keep things consistent until Scratch adds first-class lists, or something

I'm planning on making a Scratch extension for this soon, mostly for proof-of-concept, and I'll put it in OP

Last edited by ajskateboarder (Dec. 11, 2023 15:54:07)

cookieclickerer33
Scratcher
1000+ posts

Text similarity

The block would return the item in the list that is most similar to the provided string.
To get a specific one like 3rd most similar you could do this
define The (num) most similar to (text) in (list)
Copy (list::custom) to [copied v]::list
Set [output v] to (closest to (text::custom) in [copied v]::list)
repeat ((num::custom) - (1))
Delete (item # of (closest to (text::custom) in [copied v]::list)) of [copied v]
Set [output v] to (closest to (text::custom) in [copied v]::list)
end
Return (output)::custom cap
That’s what I ment by Itterate
ajskateboarder
Scratcher
1000+ posts

Text similarity

Bump

cookieclickerer33 wrote:

The block would return the item in the list that is most similar to the provided string.
To get a specific one like 3rd most similar you could do this
define The (num) most similar to (text) in (list)
Copy (list::custom) to [copied v]::list
Set [output v] to (closest to (text::custom) in [copied v]::list)
repeat ((num::custom) - (1))
Delete (item # of (closest to (text::custom) in [copied v]::list)) of [copied v]
Set [output v] to (closest to (text::custom) in [copied v]::list)
end
Return (output)::custom cap
That’s what I ment by Itterate
Yeah I know, but it may be confusing when people iterate over lists with this block:

(item (n) of [list v] :: list)

So we should have a similar block to what people already use, for consistency
cookieclickerer33
Scratcher
1000+ posts

Text similarity

I don’t agree because it’s much smaller and easier to understand than whatever that big list block is
Gamer_Logan819
Scratcher
1000+ posts

Text similarity

Bump

Powered by DjangoBB