pyaiml21.utils.load_files.load_aiml_set

pyaiml21.utils.load_files.load_aiml_set(filename: str) Set[str][source][source]

Try to load AIML set and guess its format.

The loaded set is normalized – in the sense that letters are uppercase-d and extra spaces removed.

See aiml_set_fromstring for examples of usage.

Supported formats include:
  1. ALICE format: one line per phrase,

  2. Pandorabots format [json]: list of strings,

    or list of lists of words

Parameters

filename – name of file to parse

Returns

parsed AIML set

Raises

ValueError if filename does not represent an AIML set