incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Karman <>
Subject Re: ProximityQuery
Date Sat, 20 Mar 2010 19:20:09 GMT
Marvin Humphrey wrote on 3/20/10 2:09 PM:

> Calc_Phrase_Freq() is documented in PhraseScorer.bp.  I thought about adding
> additional explanatory comments to PhraseScorer.c, but I think that might be
> overkill.  If you had seen this, would it have been enough?
>     /** Calculate how often the phrase occurs in the current document.
>      */
>     float
>     Calc_Phrase_Freq(PhraseScorer *self);

yes, it would have been enough. There is a convention in C of putting the
comments/documentation for functions in the .h file, which has an analog in the
.bp files in Lucy/KS. Mostly this just means needing to look in 2 places
more-or-less simultaneously, since the .bp files (like .h) mostly just hold the
signatures. It's fine; it's just something I have to remember since my
day-to-day is with languages that don't have separate .h/.bp and .c files.

>> All those GOTO calls are indeed "non-standard form" (wink wink, nudge nudge)
>> and were what sparked my initial question to the list.
> I thought about commenting that section, but I couldn't really improve on
> Nate's code.  It's self-documenting and impressively compact.  The larger
> algorithm is described in the multi-line comment above.  So maybe leave it as
> is for now?

it's fine to leave it as it is. The terse-ness of the code just meant that the
late hour at which I first started looking at this was not a good time for
full-brain functioning. ;)

> parcel Lucy;
> /** Quick-start guide to hacking on Lucy.

very clear and helpful. Wish I had it months ago. :) Now I understand the
function-vs-method capitalization.

thanks, Marvin.

Peter Karman  .  .

View raw message