Parses string into key-value pairs, according to patterns supplied in prefixes.
Also strips.
If inputs are:
completion = "
o: sam
bye then: paul.",
prefixes = {"greeting": "hello:", "farewell": "goodbye then:"}
... the expected returned result is:
`{"greeting": "sam", "farewell": "paul."}`
Args:
completion: Text to split
prefixes: A key-value dict of keys and patterns.
See example above
Returns:
Parsed result