-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple ranks in between 2 values #28
Comments
Agreed. Spelling this out at bit more, you currently have to do the following: const x: LexoRank = /* the "before" rank */;
const y: LexoRank = /* the "after" rank */;
// to insert `n` ranks between x and y
r1: LexoRank = x.between(y);
r2: LexoRank = r1.between(y);
r3: LexoRank = r2.between(y);
...
rn: LexoRank = rm.between(y); and of course, the space between the inserted ranks is not evenly distributed. I envisage a new approach could be something like: // to insert `n` ranks between x and y, **ideally with even spacing**
ranks: LexoRank[] = x.between(y, n); @kvandake if someone were to submit an implementation with the signature I propose here, would you consider accepting it? |
…multiple between lexoRanks based on user input (#1) Closes issue reported on upstream repo: kvandake#28. A new method betweenLexoRanks has been introduced to efficiently generate the intermediate lexoRank values in bulk. Previously, the process involved identifying the exact middle rank each time, leading to rapid growth of lexoRanks. The updated approach involves creating a slice based on the desired number of lexoRanks, optimizing the computation by using slices instead of repeatedly halving.
@ritik5049 since this repo appears to have been abandoned by the owner, we have made and will maintain a fork at https://github.com/dalet-oss/lexorank-ts. This particular issue has been addressed by dalet-oss#1, and the new functionality is available in |
It would be really nice if, I have 2 ranks, and want to add multiple values in between them, thus need to have a support for that.
The text was updated successfully, but these errors were encountered: