lexsync

Lexical optimisation and hardware-timed experiment generation. Twin, feature-parity packages that select stimuli matched across several lexical dimensions from a corpus in any of dozens of languages, counterbalance them, and generate the experiment that presents them for PsychoPy, OpenSesame or the browser. The R and Python engines produce byte-identical materials.

R package

Reference and guides (pkgdown). Not yet on CRAN, so install it from this repository with remotes::install_github("pablobernabeu/lexsync", subdir = "R_workflow").

Python package

Reference and guides (mkdocs). On PyPI, so install it with pip install lexsync, adding the corpora or experiment extra in brackets when you need the wordfreq connector or the hardware playback dependencies.

Run a generated experiment

Every worked design in the repository ships as a browser experiment, written by the same pipeline that emits the PsychoPy and OpenSesame scripts and rendered from the same declarative event list. These are build artefacts rather than mock-ups: each is a single HTML file carrying its own trial list, so it runs by being opened. Two contrasting paradigms are below, and all twenty-one are listed together, among them related versus unrelated priming, cued categorisation, a lexical decision carrying practice and filler blocks, and a Mandarin Chinese frequency contrast on a logographic script.

Lexical decision

English words in a frequency band against length-matched, orthographically legal pseudowords, generated deterministically by constrained letter substitution. Sixty items per condition.

Self-paced reading

Grammatical against ungrammatical sentences (subject-verb agreement), presented region by region and advanced with the space bar, each followed by a comprehension question.

The two point-and-click applications work differently and are not published here. The Shiny and Streamlit front-ends call the R and Python engines directly, so each one needs a local install and a server of its own. See apps/README.md for how to launch them.