pyaiml21.utils.load_files.aiml_sub_fromstring¶
- pyaiml21.utils.load_files.aiml_sub_fromstring(s: str) Mapping[str, str][source][source]¶
Guess the format and parse AIML substitutions from the given string.
- Parameters
s – string representing AIML substitutions
- Returns
parsed substitutions
- Raises
ValueError if s does not represent an AIML substitutions
- Examples:
>>> s = " a :1\nb: c \nd:e" >>> aiml_sub_fromstring(s) == {" a ": "1", "b": " c ", "d": "e"} True