* fix: Chinese test suite Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working. * fix: ran script, updated testStrings and solutions
3.2 KiB
3.2 KiB
title, id, challengeType, videoUrl, localeTitle
title | id | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
Jaro distance | 5a23c84252665b21eecc7ec2 | 5 | Jaro距离 |
Description
- \(m \)是匹配字符的数量;
- \(t \)是换位次数的一半。
- \(m = 4 \)
- \(| s_1 | = 6 \)
- \(| s_2 | = 5 \)
- \(t = 0 \)
Instructions
Tests
tests:
- text: <code>jaro</code>应该是一个功能。
testString: assert(typeof jaro=='function');
- text: <code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code>应返回一个数字。
testString: assert(typeof jaro('MARTHA', 'MARHTA')=='number');
- text: <code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code>应该返回<code>"+results[0]+"</code> 。
testString: assert.equal(jaro('MARTHA', 'MARHTA'), 0.9444444444444445);
- text: <code>jaro(""+tests[1][0]+"",""+tests[1][1]+"")</code>应返回<code>"+results[1]+"</code> 。
testString: assert.equal(jaro('DIXON', 'DICKSONX'), 0.7666666666666666);
- text: <code>jaro(""+tests[2][0]+"",""+tests[2][1]+"")</code>应返回<code>"+results[2]+"</code> 。
testString: assert.equal(jaro('JELLYFISH', 'SMELLYFISH'), 0.8962962962962964);
- text: <code>jaro(""+tests[3][0]+"",""+tests[3][1]+"")</code>应返回<code>"+results[3]+"</code> 。
testString: assert.equal(jaro('HELLOS', 'CHELLO'), 0.888888888888889);
- text: <code>jaro(""+tests[4][0]+"",""+tests[4][1]+"")</code>应该返回<code>"+results[4]+"</code> 。
testString: assert.equal(jaro('ABCD', 'BCDA'), 0.8333333333333334);
Challenge Seed
function jaro (s, t) {
// Good luck!
}
After Test
console.info('after the test');
Solution
// solution required