//#region src/lib/utilities/license-identification.d.ts /** * License identification using Dice coefficient on bigrams. * * Compares license files against compact, precomputed SPDX fingerprints. * Similarity is separate from whether the normalized text matches exactly. The * original license texts are only needed when generating the corpus. * * Handles: * * - Canonical SPDX / vendor URLs embedded in pointer-style license files * - Standard license texts (MIT, BSD, Apache, etc.) * - GNU family licenses via header pattern matching (LGPL, AGPL) * - Markdown-formatted license files (strips headings, tables, links) * - YAML front matter stripping */ export type LicenseMatch = { /** * Character-bigram Dice similarity (0–1), not a probability. References use * 1. */ confidence: number; /** Full license name (e.g. "MIT License", "Apache License 2.0"). */ name: string; /** Whether the license is OSI approved. */ osiApproved: boolean; /** SPDX license identifier (e.g. "MIT", "Apache-2.0"). */ spdxId: string; /** SPDX license URL. */ spdxUrl: string; /** * Exact normalized text, explicit reference, likely modified text, or an * uncertain candidate. */ status: 'exact' | 'modified' | 'reference' | 'uncertain'; }; //#endregion