Expose memory compensator families
This commit is contained in:
parent
1cc31f1e0a
commit
021e34362c
13 changed files with 1713 additions and 1658 deletions
|
|
@ -370,6 +370,20 @@ export function appendClause(existing, clause) {
|
|||
return `${left} ${right}`;
|
||||
}
|
||||
|
||||
export function appendUniqueString(items, value, limit) {
|
||||
const normalized = normalizeText(value);
|
||||
if (!normalized) {
|
||||
return;
|
||||
}
|
||||
if (items.includes(normalized)) {
|
||||
return;
|
||||
}
|
||||
items.push(normalized);
|
||||
if (items.length > limit) {
|
||||
items.splice(0, items.length - limit);
|
||||
}
|
||||
}
|
||||
|
||||
export function topicSimilarity(left, right) {
|
||||
const leftTokens = topConceptKeywords(left ?? "", 6);
|
||||
const rightTokens = topConceptKeywords(right ?? "", 6);
|
||||
|
|
|
|||
Loading…
Reference in a new issue