Is there an existing algorithm to do something like this, from a number of results, recreate the original format string.
For example, here are the input:
"the fox jumps over the lazy brown dog"
"the man jumps over the lazy black cat"
"the dolphin jumps over the big wave"
=> output:
output="the {} jumps over the {}"
There are multiple format strings that work, but we should get the one with highest number of characters that do not belong to place holders, and lowest number of place holders.
since in python, we have:
"the fox jumps over the lazy brown dog" = output.format('fox', 'lazy brown dog')
"the man jumps over the lazy black cat" = output.format('man ', 'lazy black cat')
"the dolphin jumps over the big wave" = output.format('dolphin', 'big wave')
or even better in C, assuming with enough inputs, we can get
output = "the %s jumps over the %s"