I am currently thinking about introducing a mechanism used in major IDEs which allow users to type not correctly matched search patterns for the smart auto completion component.
Imagine searching for superTest and just pre will suffice because superTest. But what if we want to allow ptr which would not match because the r is before the t.
I thought about an algorithm which puts a penalty on the search for each time the algorithm has to move backwards to search for a match. In the example above the algorithm would return -1 because it had to move back for the r once. The entries would be sorted by the penalty added to the matching distance. The fine tuning is important how to integrate the penalty into the distance metric.
I am currently thinking about introducing a mechanism used in major IDEs which allow users to type not correctly matched search patterns for the smart auto completion component.
Imagine searching for
superTest
and justpre
will suffice because superTest. But what if we want to allowptr
which would not match because ther
is before thet
.I thought about an algorithm which puts a penalty on the search for each time the algorithm has to move backwards to search for a match. In the example above the algorithm would return
-1
because it had to move back for ther
once. The entries would be sorted by the penalty added to the matching distance. The fine tuning is important how to integrate the penalty into the distance metric.