titus.prettypfa.engine

titus.prettypfa.engine(text, options=None, version=None, sharedState=None, multiplicity=1, style='pure', debug=False, subs={}, **subs2)[source]

Parse PrettyPFA and construct scoring engine instances from it.

Parameters:
  • text (string) – PrettyPFA to parse
  • version (string or None) – version of the PFA language to use while interpreting (None defaults to titus.version.defaultPFAVersion)
  • sharedState (titus.genpy.SharedState) – external state for shared cells and pools to initialize from and modify; pass None to limit sharing to instances of a single PFA file
  • multiplicity (positive integer) – number of instances to return (default is 1; a single-item collection)
  • style (string) – style of scoring engine; only one currently supported: “pure” for pure-Python
  • debug (bool) – if True, print the Python code generated by this PFA document before evaluating
  • subs (dict from substitution names to substitutions) – replacement values as PFA titus.pfaast.Ast, PrettyPFA strings, or PFA Pythonized JSON
  • subs2 (dict from substitution names to substitutions) – added to subs (a more convenient way to pass them)
Return type:

list of titus.genpy.PFAEngine

Returns:

a list of scoring engine instances