Patch for Highlighter.makeSample

2 views
Skip to first unread message

Yannick Gingras

unread,
Aug 3, 2010, 10:49:57 PM8/3/10
to xappy-...@googlegroups.com

Hello Xappy devs,
please find attached a patch for `Highlighter.makeSample()`. The
previous algorithm had a very bad tendency to strip search terms from
the sample and it was putting double dots ("..") very often where it
should have used the ellipsis ("..."). The current algorithm is not
perfect and it will also strip the search terms is they appear at the
end of a long sentence and that that sample size is very small but
that should not happen very often in real life. The complexity is not
changed.

The `block-class` patch should be applied before the
`better-sample-production` one.

Cheers,

--
Yannick Gingras
http://ygingras.net
http://montrealpython.org -- lead organizer

block-class
better-sample-production
signature.asc
Reply all
Reply to author
Forward
0 new messages