liwca.datasets.dictionaries.path

On this page

liwca.datasets.dictionaries.path#

liwca.datasets.dictionaries.path(name, **kwargs)[source]#

Return the local path to the cached .dicx for a named dictionary.

Calls the corresponding fetch_<name>(**kwargs) to ensure the .dicx cache is populated, then returns the local path. Useful for handing off to tools that consume a .dicx file directly (e.g., the LIWC-22 CLI).

Parameters:
  • name (str) – Friendly dictionary name, matching one of the public fetch_<name> functions (e.g., "sleep", "emfd", "bigtwo").

  • **kwargs – Forwarded to the underlying fetcher (e.g., version="b" for "bigtwo").

Returns:

Path to the cached .dicx file.

Return type:

Path

Raises:

ValueError – If name does not correspond to a known fetcher.

Examples

>>> from liwca.datasets import dictionaries
>>> dictionaries.path("sleep")
PosixPath('.../dictionaries/sleep.dicx')
>>> dictionaries.path("bigtwo", version="b")
PosixPath('.../dictionaries/bigtwo-vb.dicx')
>>> dictionaries.path("wrad")
PosixPath('.../dictionaries/wrad.dicx')