Dictionary API

Public dictionary-source API.

pstrain.api.dictionary.default_cmudict_cache()[source]

Return the CMUdict cache within pstrain’s benchmark cache hierarchy.

Return type:

Path

pstrain.api.dictionary.fetch_cmudict(ref='HEAD', cache=None)[source]

Fetch, convert, and cache CMUdict from its original upstream source.

ref may be a tag, branch, or commit SHA. Network access happens only in a fresh child process. On macOS, an in-process HTTPS download followed by a native worker spawn crashes the interpreter, so the download is kept out of any process that later spawns workers.

Parameters:
Return type:

CMUDictSource

class pstrain.api.dictionary.CMUDictSource[source]

Paths and revision metadata for a cached upstream CMUdict checkout.