1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 10:54:44 +00:00

feat(packages): add version jsdoc tags

This commit is contained in:
2024-09-30 06:20:45 +07:00
parent 975ca98f9a
commit 469ef8cdc2
7 changed files with 43 additions and 13 deletions

View File

@@ -5,6 +5,8 @@ export type Trigrams = Map<string, number>;
*
* @param {string} text The text to extract trigrams
* @returns {Trigrams} A map of trigram to count
*
* @since 0.0.1
*/
export function trigramProfile(text: string): Trigrams {
text = '\n\n' + text + '\n\n';
@@ -26,6 +28,8 @@ export function trigramProfile(text: string): Trigrams {
* @param {Trigrams} left First text trigram profile
* @param {Trigrams} right Second text trigram profile
* @returns {number} The trigram distance between the two strings
*
* @since 0.0.1
*/
export function trigramDistance(left: Trigrams, right: Trigrams): number {
let distance = -4;