Update README.md to enhance documentation on similarity metrics and usage. Add dependencies section and clarify return values for methods. Modify test.js to reflect updated search scenarios and improve clarity in search results.

This commit is contained in:
seb
2025-04-18 11:03:07 +02:00
parent 92a7bad2b6
commit 0dd17b794f
2 changed files with 39 additions and 28 deletions

View File

@@ -44,7 +44,7 @@ customIndex.addString('bizz bio mix light');
customIndex.addStrings([
'plant growth bio formula',
'garden soil substrate',
'plagron light mix',
'plagron lightmix',
'Anesia Seeds Imperium X Auto 10',
'anesi'
]);
@@ -57,8 +57,8 @@ const results = customIndex.search('amnesia haze', 0.1);
results.forEach(match => {
console.log(` ${match.similarity.toFixed(2)}: ${match.string}`);
});
console.log('\nSearching with higher similarity threshold (0.1) for "lightmix":');
const results2 = customIndex.search('lightmix', 0.1);
console.log('\nSearching with higher similarity threshold (0.1) for "mix light":');
const results2 = customIndex.search('mix light', 0.1);
results2.forEach(match => {
console.log(` ${match.similarity.toFixed(2)}: ${match.string}`);
});