Choose attributes randomly?

34 views
Skip to first unread message

JoAnn Silkes

unread,
Mar 15, 2022, 3:37:17 PM3/15/22
to E-Prime
Hi -
I'm setting up a protocol in which I'd like to have a variety of words available to mask a target word and let EPrime choose the mask word randomly each time. Each target word has specifically selected mask words, based on a variety of factors, so masks are not interchangeable between targets. Is there a way that I can create several mask attributes for each target and then call one of them randomly each time that target word is being used? (Conceptually, the idea is to have each mask in a column labeled "Mask1", "Mask2", "Mask3", etc. and then call one of them at random from that row with something like [Mask*].)

Any suggestions for how to achieve something like this?

Thanks.
JoAnn

David McFarlane

unread,
Mar 15, 2022, 3:46:00 PM3/15/22
to e-p...@googlegroups.com
JoAnn,

I think you could do this with nested Lists. You would have to create a
separate nested mask List for each target -- e.g., target1 would have
Mask1List, target2 Mask2List, etc. Each mask List would have a single
column, e.g., MaskWord, which would contain the mask words for the
associated target. Then in the main List that contains the target words
you put the associated mask List in the Nested column. Set each nested
mask List to either Random or Random with Replacement order, as appropriate.

With that all set up, each time your program selects a row from the main
list containing a target word, it will also select one row (at random)
from the nested mask List.

Hope that helps.

-- David McFarlane

Spape, Michiel

unread,
Mar 15, 2022, 3:48:51 PM3/15/22
to e-p...@googlegroups.com

Hi,

Yes, very easily in fact! Basically, add a nested list with an attribute like “MaskNum”, going from 1 to 3. In your list, have 3 columns, “Mask1”/2/3 and a fourth, “TheMask”, set the value to [Mask[MaskNum]], which translates to c.getattrib(“Mask” & c.ggetattrib(“MaskNum”)).

Just noticed David was ahead of me, but I won’t read what he says before sending this, so won’t count!

Best,

Michiel

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/f7f0f161-19ac-448c-8b43-a031a2a5376cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages