lexorank-ts icon indicating copy to clipboard operation
lexorank-ts copied to clipboard

Document rebuilding process

Open nirvdrum opened this issue 4 years ago • 2 comments

As far as I can tell, this library provides everything needed to rebuild the rankings for a list. But, there doesn't appear to be a utility method to pull everything together. It'd be helpful if there were a section in the documentation on how to generate the next bucket and start re-ranking items from the old bucket into the new bucket.

nirvdrum avatar Jan 01 '20 23:01 nirvdrum

Yes, I'm surprised that public static between(oLeft: LexoDecimal, oRight: LexoDecimal) doesn't check if there is still 'place' between two ranks, so we could fallback by rebuilding the list (change buckets?) before trying to call between again.

Full disclosure: I discover lexorank few hours ago, and there's probably something I don't understand.

loicbisiere avatar May 19 '20 16:05 loicbisiere

I too have only just discovered this algorithm and library in the last few hours and I am also surprised that we don't have some sort of failure case that is obvious in the code 🤔 I started looking through the function and the ones that it calls and I couldn't see an obvious thrown error (at least not one that was quite as obvious as the initial check at the top of the function).

I guess I would expect the system to error in the case that there is no space and then that is a signal to the caller that it's time to rebalance. Does that sound right to people? If so then I can think about putting together a test to illustrate this situation and see if it currently throws an error 👍

mansona avatar May 01 '22 13:05 mansona