String similarity algorithms for string containment (rather than string equality)
My first thought was that it's difficult to formally define this concept:

&quot;b&quot; is likely to contain &quot;a&quot; with some &quot;error&quot;


On the one hand, there is the idea that a is a substring of b. This question should have a boolean answer: either it does contain it, or it doesn't.
On the other hand there is the idea of approximate matching: b should contain a substring c which is &quot;similar enough&quot; to a. In general the question of similarity between two strings is answered with a numerical value, usually a real number between 0 and 1.

As far as I know the only way to solve this issue is to consider that there is a threshold on the similarity score between a and c, where c is any substring of b. This way the answer becomes boolean.
However there might be a way around this by considering the substring operation as part of the similarity calculation. In particular the Levenshtein edit distance can account for insertions/deletions of characters, which is what a substring is w.r.t the string which contains it.
More interestingly, it is possible to assign a different cost to any particular edit operation in the Levenshtein distance. So it's probably possible to define a variant of Levenshtein where insertions at the beginning or at the end would have cost 0, thus making the final distance $x$ between a and b equivalent to &quot;b contains a substring c which has distance $x$ against a&quot;.
The way I would try to implement this is:

Calculate the regular edit distance, keeping the matrix used for the calculation
From the matrix, count how many insertions were done but only at the beginning and at the end, then substract this value from the distance.

Note that there might be flaws in my idea, I didn't try it :D