How does similar_text work?

前端 未结 4 468
故里飘歌
故里飘歌 2020-11-29 03:43

I just found the similar_text function and was playing around with it, but the percentage output always suprises me. See the examples below.

I tried to find informa

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 04:25

    first String = aaaaaaaaaa = 10 letters
    second String = aaaaa = 5 letters
    
    first five letters are similar
    a+a
    a+a
    a+a
    a+a
    a+a
    a
    a
    a
    a
    a
    
    
    (  * 200 ) / ( + )
    
    ( 5 * 200 ) / (10 + 5);
    = 66.6666666667
    

提交回复
热议问题