all_tokens_from_aois#

pymovements.measure.reading.all_tokens_from_aois(aois: DataFrame, trial: str | None = None) DataFrame[source]#

Return every AOI token on the page in word-index order.

Includes words, spaces, and punctuation — every row that has a word_idx. If trial is provided and the trial column is absent from aois, it is added as a constant column.

Parameters:
  • aois (pl.DataFrame) – AOI table containing at least the columns page, word_idx, and word.

  • trial (str | None) – Trial identifier to attach when the trial column is absent from aois. If None and the column is already present, it is used as-is. (default: None)

Returns:

Deduplicated table with columns trial, page, word_idx, and word, sorted by word_idx.

Return type:

pl.DataFrame