fix(core): update

This commit is contained in:
2021-10-03 17:12:02 +02:00
parent cbc72cd55b
commit cb5a24320c
10 changed files with 25536 additions and 429 deletions

26
test/test.smartfuzzy.ts Normal file
View File

@@ -0,0 +1,26 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartfuzzy from '../ts/index';
let testSmartfuzzy: smartfuzzy.Smartfuzzy;
tap.test('should create an instance of Smartfuzzy', async () => {
testSmartfuzzy = new smartfuzzy.Smartfuzzy([
'Sony',
'Deutsche Bahn',
'Apple Inc.',
"Trader Joe's"
]);
expect(testSmartfuzzy).to.be.instanceof(smartfuzzy.Smartfuzzy);
});
tap.test('should compute a score', async () => {
const result = testSmartfuzzy.getChangeScoreForString('Apple');
console.log(result);
});
tap.test('should get closest match', async () => {
const result = testSmartfuzzy.getClosestMatchForString('Apple');
console.log(result);
});
tap.start();