Skip to main content

Module similar

Module similar 

Source
Expand description

Is a new feature’s description close to a requirement the project already has? A deterministic text similarity — normalised tokens, a fixed stop-word list, a suffix stemmer, TF-IDF weights over the project’s requirements and cosine — so the answer is the same on every run and explains itself by the terms it shares. A hint: it never blocks, and no model produces or suppresses a match.

Structs§

Place
Where a requirement is written.
Requirement
One requirement of the corpus.
SimilarMatch
A requirement close to the description.
SimilarReport
The similar payload: what was compared and what is close.

Enums§

SimilarLevel
How close a match is.

Constants§

CLOSE
A score at or above this is close.
MAX_MATCHES
At most this many matches.
MAX_SHARED
At most this many shared terms per match.
MAX_UNITS
The corpus is limited to the requirements of this many units, the most recently changed first.
VERY_CLOSE
A score at or above this is very close.

Functions§

matches
The requirements of corpus at or above CLOSE to query, at most MAX_MATCHES, by score, then unit number, then identifier. The same input gives the same output; an empty query gives none.
shared_terms
The terms two texts share, sorted (for a symmetric check).
tokenize
The terms of text: NFKC-normalised, lowercased runs of letters and digits of two characters or more, stop words dropped, stemmed.