function sortedMatches(text) {
	return Object.keys(links)
		.map(function (keyword) {
			return {
				// Determine similarity to text for each keyword.
				keyword: keyword,
				similarity: similarity(text, keyword)
			}
		})
		.filter(function (value) {
			// Exclude totally dissimilar keywords.
			return value.similarity > 0
		})
		.sort(function (lhs, rhs) {
			// Sort keywords by most similar.
			return lhs.similarity > rhs.similarity
		})
		.map(function (value) {
			return value.keyword
		})
}
// Result excludes keywords that are too dissimilar to the given text, and may be empty.
Result excludes keywords that are too dissimilar to the given text, and may be empty.
Result excludes keywords that are too dissimilar to the given text and may be empty .
function sortedMatches(text) {
	return Object.keys(links)
		.map(function (keyword) {
			return {
				keyword: keyword,
				similarity: similarity(text, keyword)
			}
		})
		.filter(function (value) {
			return value.similarity > 0
		})
		.sort(function (lhs, rhs) {
			return lhs.similarity > rhs.similarity
		})
		.map(function (value) {
			return value.keyword
		})
}
function sortedMatches ( text ) { return Object . keys ( links ) . map ( function ( keyword ) { return { keyword : keyword , similarity : similarity ( text , keyword ) } } ) . filter ( function ( value ) { return value . similarity > 0 } ) . sort ( function ( lhs , rhs ) { return lhs . similarity > rhs . similarity } ) . map ( function ( value ) { return value . keyword } ) }
Result excludes keywords that are too dissimilar to the given text, and may be empty.
Result excludes keywords that are too dissimilar to the given text and may be empty .
// Determine similarity to text for each keyword. // Exclude totally dissimilar keywords. // Sort keywords by most similar.