This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.rules = rules = [] | |
| exports.addRule = addRule = (from, to) -> | |
| rules.push { | |
| from: from | |
| to: to | |
| } | |
| addRule /[aehiouy]/g, '' | |
| addRule /[йуеёыахоэяиюьъ]/g, '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| soundex = require './soundex' | |
| console.log 'rules:' | |
| console.log soundex.rules | |
| words = [ | |
| 'Барселона' | |
| 'barcelana' | |
| 'hello' | |
| 'хеллоу' | |
| 'ворд' | |
| 'word' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var rules = [ | |
| [/[aehiouy]/g, ''], | |
| [/[йуеёыахоэяиюьъ]/g, ''], | |
| [/[с]?тч/g, 'щ'], | |
| [/rl/g, 'r'], | |
| [/[bfpvw]/g, '1'], | |
| [/[бфпв]/g, '1'], | |
| [/[cgjkqsxz]/g, '2'], | |
| [/[цжкзсг]/g, '2'], | |
| [/[dt]/g, '3'], |