@libraz/libcantus - v1.1.0
    Preparing search index...

    Function profileWeights

    • Resolve a profile to the weights that rank its candidates, with per-field overrides applied on top.

      Parameters

      • profile: SafetyProfile

        The profile whose table to start from.

      • Optionaloverrides: Partial<ProfileWeights>

        Fields to replace; anything absent keeps the profile's value. A field written as an explicit undefined is absent, not a replacement.

      Returns ProfileWeights

      The complete weight table to score with.

      If profile is not one of the profile names, or an override is not a finite number (InvalidInputError). A misspelled profile scored under a default table would rank candidates by a style the caller did not ask for, and a single non-finite weight poisons every candidate's score, which turns the ranking into the order the candidates happened to be enumerated in.

      import { profileWeights } from '@libraz/libcantus';
      profileWeights('pop', { parallelImperfect: 4 }).contraryMotion; // 1.5 — the rest is untouched