v2.ocaml.org icon indicating copy to clipboard operation
v2.ocaml.org copied to clipboard

fix a FIXME in rss2html.ml while printing author name in blog feed

Open shreyaswikriti opened this issue 3 years ago • 3 comments

I came across a FIXME in rss2html.ml page. that asks to check for word boundaries while printing author-name. I would like to fix this issue if approved.

shreyaswikriti avatar Apr 21 '21 17:04 shreyaswikriti

@shreyaswikriti Were you able to figure out what the Fixme implies? @pitag-ha and I looked at it but couldn't decipher what the FIXME meant :)

gs0510 avatar Apr 22 '21 18:04 gs0510

@gs0510, what I understand from the functions && not(Utils.KMP.is_substring ~pat:a.name feed_author) && not(Utils.KMP.is_substring ~pat:feed_author a.name) is: this line is searching that a.name should not be present in feed_author and vice versa. using is_substring function, it returns true even if the substring is present in between the string. Setting word boundaries returns true only if the substring is present as a whole word. Here is the explanation: Suppose feed_author='swikriti' a.name='shreyaswikriti' not(Utils.KMP.is_substring ~pat:feed_author a.name) -->not(true)-->false But there can be a possibility that this can be the name of two different persons. Giving false results won't generate a new feed_author. Now checking using word boundary : it results that 'swikriti' has no word boundary in 'shreyaswikriti' because 'shreyaswikriti' doesn't start with the word 'swikriti' this gives the result that a new feed_author can be formed with the name 'swikriti'.

shreyaswikriti avatar Apr 25 '21 14:04 shreyaswikriti

That makes sense @shreyaswikriti! You can go ahead and fix this :)

gs0510 avatar Apr 26 '21 09:04 gs0510