A tokenized-text stimulus is similar to the text stimulus, with additional options for manipulating the stimulus on a token-by-token basis (in most cases, a token is a word). A tokenized-text stimulus can be particularly useful for creating a self-paced reading study.
<abbr>
, <acronym>
, <b>
, <blockquote>
, <code>
, <em>
, <i>
, <li>
, <ol>
, <strong>
, <ul>
, <p>
.{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed."
}
type
must be specified as tokenized_text
.{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed."
}
"left"
, "right"
and "center"
"left"
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"alignment": "right"
}
Relevant only if mode is set to masked
true
, then tokens preceeding the active token are displayed as the mask character; if set to false
, then tokens preceeding the active token are displayed normally.true
or false
true
forward_mask
, masked_spaces
, and mask_char
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"mode": "masked",
"backward_mask": false
}
Available since August 14, 2023
Relevant only if self_paced is set to
true
true
, participants can press one key to advance the tokens and another key to reverse. Reading/reaction times are recorded for each forward and backward action.true
or false
false
(i.e., forward self-paced only){
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true,
"bidirectional": true
}
Relevant only if mode is set to "masked"
true
, then tokens preceeding the active token are displayed as the mask character; if set to false
, then tokens preceeding the active token are displayed normally.true
or false
true
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"mode": "masked",
"backward_mask": false
}
"red"
, "darkgreen"
, or hex codes like "#FF6600"
"black"
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"color": "#FF6600"
}
0
(no delay){
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed",
"delay": 1.6
}
The above code introduces a delay of 1600 milliseconds.
delimiter
should be interpreted as a regular expression (instead of a string), regex
must be set to true
.regex
{
"type": "tokenized_text",
"content": "apple,orange,lemon,lime,banana",
"delimiter": ","
}
Because delimiter is set to ","
(a comma), "apple", "orange", "lemon", "lime", and "banana" will be displayed as separate tokens.
Relevant only if mode is set to masked
true
, tokens following the active token will appear in the mask character; if set to false
, then tokens following the active token are invisible.true
or false
false
backward_mask
, masked_spaces
, and mask_char
{
"type": "tokenized_text",
"content": "The tokens following the active token will be masked.",
"mode": "masked",
"forward_mask": true
}
Available since August 14, 2023.
key_advance
to a different key, then "[SPACE]" will be replaced by that key. In the case of bidirectional self-paced reading, both keys will be listed.true
or false
true
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true,
"key_advance": "j",
"hint": false
}
Because *hint is set to false
, no instruction will be displayed with this stimulus. If hint were set to true
, participants would see the following instruction: "Press the "j" key to advance."
true
, then the tokens are displayed with the delimiter character between tokens; if false
, then the tokens are displayed with a space between tokens.true
or false
false
regex
, delimiter
{
"type": "tokenized_text",
"content": "apple,orange,lemon,lime,banana",
"delimiter": ",",
"keep_delimiter": true
}
Because delimiter is set to ","
(a comma), "apple", "orange", "lemon", "lime", and "banana" will be displayed as separate tokens. Because keep_delimiter is set to true
, the comma will appear when the tokens are displayed: "apple,orange,lemon,lime,banana"
If keep_delimiter were set to false
, the tokens would be separated by a "[SPACE]": "apple orange lemon lime banana"
true
or false
false
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"mode": "masked",
"keep_last": true
}
Relevant only if self_paced is set to
true
"ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "ShiftLeft", "ShiftRight", "ControlLeft", "ControlRight", "AltLeft", "AltRight"
false
, the default is " "
(the space bar); when bidirectional is true
, the default is "ArrowRight"
(the right arrow key).{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true,
"key_advance": "j" // change the key to the letter J key
}
Avoid setting the key to any Shift keys unless your participants are in a controlled lab environment. Some Operating Systems (e.g., Windows) associate system actions with repeated presses of Shift keys and may interfere with experiment progress.
Deprecated since August 14, 2023. Use hint instead.
key_advance
to a different key, then "[SPACE]" will be replaced by that key.true
or false
true
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true,
"key_advance": "j",
"key_advance_instruction": false
}
Because key_advance_instruction is set to false
, no instruction will be displayed with this stimulus. If key_advance_instruction were set to true
, participants would see the following instruction: "Press the "j" key to advance."
Available since August 14, 2023
Relevant only if self_paced and bidirectional are both set to
true
"ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "ShiftLeft", "ShiftRight", "ControlLeft", "ControlRight", "AltLeft", "AltRight"
"ArrowLeft"
(i.e., the left arrow key){
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true,
"bidirectional": true,
"key_advance": "AltRight" // change the key advancing the tokens to the right Alt key
"key_reverse": "AltLeft" // change the key reversing the tokens to the left Alt key
}
Avoid setting the key to any Shift keys unless your participants are in a controlled lab environment. Some Operating Systems (e.g., Windows) associate system actions with repeated presses of Shift keys and may interfere with experiment progress.
Relevant only if mode is set to masked
mode
is "masked". For example, if the mask character is “*”, when the token TOKEN is no longer active, it will be displayed as “*****”."#"
mode
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"mode": "masked",
"mask_char": "*"
}
Relevant only if mode is set to masked
true
, all spaces in a token will be displayed in the mask character; if false
, all spaces in a token will be displayed as a space, revealing word boundaries and lengths.true
or false
true
mode
, mask_char
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be masked.",
"mode": "masked",
"masked_spaces": false
}
When the masked_spaces property is set to false
, the content will be masked as follows:
When the masked_spaces property is set to true
(its default value), the content will be masked as follows:
"plain"
, where tokens are displayed in sequence, "masked"
, where only one active token is displayed and other tokens explicitly masked, and "singleton"
, where only one active token is displayed with all other tokens invisible."plain"
, "masked"
, and "singleton"
"plain"
mask_char
, forward_mask
, backward_mask
, masked_spaces
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"mode": "masked"
}
"t_t_1": {
"type": "tokenized_text",
"content": "This text will be masked",
"key_advance": "j",
"mode": "masked",
"barrier": false
}
"t_t_2": {
"type": "tokenized_text",
"content": "This text will not be masked",
"parent": "t_t_1",
"mode": "plain"
}
Here, the t_t_2 stimulus inherits the barrier and key_advance properties of t_t_1. t_t_2 does not inherit the mode property of t_t_1 because the stimulus definition of t_t_2 has its own specified mode property.
true
, the delimiter is interpreted as a regular expression instead of a string.true
or false
false
delimiter
{
"type": "tokenized_text",
"content": "We want to display each word AND each half of half-baked separately!",
"self_paced": true,
"mode": "plain",
"delimiter": "[\\s-]",
"regex": true,
"keep_delimiter": true
}
In this example code, the delimiter "[//s-]", when interpreted as a regex, will recognize either spaces or dashes as boundaries between tokens. In the content "We want to display each word AND each half of half-baked seperately," every space will mark token boundaries, such that "We", "want", "to", etc. are displayed as distinct tokens. Additionally, dashes ("-") will mark boundaries, so "half" and "baked" are recognized as separate tokens.
true
, then the display of tokens in a tokenized text stimulus must be triggered by participant interaction, and reaction time for each token is recorded; if false
, then each tokenized text stimulus will be automatically presented.true
, false
false
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": true
}
When
self_paced
istrue
andkey_advance
is not set, the default key-press required to advance will be "[SPACE]" (the space bar). To change this key, use the key_advance property.
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"size": "50px"
}
Relevant only if self_paced
is false
& token_duration
is not specified
6
) to be displayedself_paced
, token_duration
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": false,
"speed": 5
}
In this sample code, 5 characters will be displayed every second.
Relevant only if "self_paced"
is false
& speed
is not specified
2
) to be displayedself_paced
, speed
{
"type": "tokenized_text",
"content": "The text in these quotation marks will be displayed.",
"self_paced": false,
"token_duration": 2
}
In this sample code, a new token will be displayed every 2 seconds.
Design Pattern: Respond at the Right Time