Skip to content

Instantly share code, notes, and snippets.

@kwik101
kwik101 / soundex2.js
Created August 9, 2011 16:59
soundex with Russian launguage support js version
var rules = [
[/[aehiouy]/g, ''],
[/[йуеёыахоэяиюьъ]/g, ''],
[/[с]?тч/g, 'щ'],
[/rl/g, 'r'],
[/[bfpvw]/g, '1'],
[/[бфпв]/g, '1'],
[/[cgjkqsxz]/g, '2'],
[/[цжкзсг]/g, '2'],
[/[dt]/g, '3'],
@kwik101
kwik101 / soundex_test.coffee
Created August 9, 2011 16:37
test for gist.github.com/1134511
soundex = require './soundex'
console.log 'rules:'
console.log soundex.rules
words = [
'Барселона'
'barcelana'
'hello'
'хеллоу'
'ворд'
'word'
@kwik101
kwik101 / soundex.coffee
Created August 9, 2011 16:34
soundex with Russian launguage support
exports.rules = rules = []
exports.addRule = addRule = (from, to) ->
rules.push {
from: from
to: to
}
addRule /[aehiouy]/g, ''
addRule /[йуеёыахоэяиюьъ]/g, ''