IF Commons GitHub

logical/duplicates

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0003-planning-reconcile FR-007

Likely duplicates (0037-planning FR-019): a similarity of the titles, bodies and places of two counted items (the overlap of their lower-cased words, with a share for the same place), and for each pair at or above the threshold a proposed link of kind same as, with its score. The same items and threshold give the same proposals in the same order, and nothing is merged, closed or hidden.

import { similarity } from "./duplicates.ts";
similarity("fix the login page", "fix login page now"); // 0.6

Source: commons/planning/src/logical/duplicates.ts

0 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.ProposedLinktypeno test imports it
type ProposedLink = { readonly link: Link; readonly state: "proposed"; readonly score: number };

A link of kind same as that a person confirms, with how alike the two are.

logical.similarityfunctionno test imports it
function similarity(a: string, b: string): number

The overlap of the words of two texts: the shared words over the words of either, from 0 to 1.

logical.scoreOffunctionno test imports it
function scoreOf(a: Item, b: Item, placesOf?: (id: ItemId) => readonly string[]): number

The score of two items: the title counts most, the body and the places they were seen in count too.

logical.findDuplicatesfunctionno test imports it
function findDuplicates(items: readonly Item[], threshold: number, placesOf?: ((id: ItemId) => readonly string[]) | undefined): readonly ProposedLink[]

The proposed links of kind same as between the counted items that are alike at or above the threshold, best first and then by id, for items not already linked as the same.

ProposedLinktypeno test imports it
type ProposedLink = { readonly link: Link; readonly state: "proposed"; readonly score: number };

A link of kind same as that a person confirms, with how alike the two are.

similarityfunctionno test imports it
function similarity(a: string, b: string): number

The overlap of the words of two texts: the shared words over the words of either, from 0 to 1.

scoreOffunctionno test imports it
function scoreOf(a: Item, b: Item, placesOf?: (id: ItemId) => readonly string[]): number

The score of two items: the title counts most, the body and the places they were seen in count too.

findDuplicatesfunctionno test imports it
function findDuplicates(items: readonly Item[], threshold: number, placesOf?: ((id: ItemId) => readonly string[]) | undefined): readonly ProposedLink[]

The proposed links of kind same as between the counted items that are alike at or above the threshold, best first and then by id, for items not already linked as the same.

Titles, headings, exports, tables, columns and requirements. Esc closes.