Make cosine reject vectors of different lengths in the translator diarizer #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The translator carries a byte-identical copy of the copilot diarizer.
cosinein diarize.mjs returns NaN forcosine([1, 2, 3], [1, 2])and ignores the extra component incosine([1, 0], [1, 0, 5]). Why it matters: The two apps must keep the same diarizer; fixing only one copy makes the copies drift apart.Proposal
Throw an Error whose message starts with
cosine:when the two arrays differ in length, exactly as the copilot task does. Keep the results for equal lengths.Acceptance criteria
cosine([1, 2, 3], [1, 2])throws an Error whose message starts withcosine:.cosine([1, 0], [1, 0, 5])throws an Error whose message starts withcosine:.cosine([1, 0], [1, 0])returns 1.cosine([0, 0], [0, 0])returns 0.Files
diarize.mjsT2T-Issue: 0x98f19ce946d4ef692a1354cdda7c9c22c3deb8168f1eb224b4d56b790e2ca305
Number: 1
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 158