in reply to Measuring Substrings Problem

Just a thought ....
What should happen when one sub-string can match multiple times?
e.g. GG can match twice
my above implimentation will only handle match the first time & score 2 insetead of 4.



This is not a Signature...

Replies are listed 'Best First'.
Re^2: Substring Distance Problem
by monkfan (Curate) on Apr 08, 2005 at 16:43 UTC
    Hi monkey_boy,

    Thanks so much for your answer.
    However, if there is a repeated substring cases as you mentioned, it should be scored as 4.

    Update: With slight modification to your code -by including offset- I managed to accomodate the duplicated case: