When i'th character of el_value is equal to the j'th character of text, we take the matched length of el_value[0:i-1] and text[0:j-1] (which is hash[i-1][j-1]) and add 1 to it. Hence, it is hash[i-1][j-1] + 1.

I hope this is clear