Skip to content

Clean and simple regex implementation of Kölner Phonetik, a soundex-like algorithm for German language

Notifications You must be signed in to change notification settings

eposjk/cologne-phonetic

 
 

Repository files navigation

Kölner Phonetik

Soundex-like algorithm for German language. Reduces phrases to their phonetic stem.

see Wikipedia (or in German)

Try it

https://maxwellium.github.io/cologne-phonetic/

Usage

const { strictEqual } = require( 'assert' );
const { colognePhonetic } = require( 'cologne-phonetic' );

const FIXTURES = [
  [ 'müller'             , '657'      ],
  [ 'schmidt'            , '862'      ],
  [ 'schneider'          , '8627'     ],
  [ 'fischer'            , '387'      ],
  [ 'Wikipedia'          , '3412'     ],
  [ 'Müller-Lüdenscheidt', '65752682' ],
  [ 'Breschnew'          , '17863'    ],
  [ 'Meier'              , '67'       ],
  [ 'Mayr'               , '67'       ],
  [ 'Maier'              , '67'       ],
];

for ( const [ input, expected ] of FIXTURES ) {
  strictEqual( colognePhonetic( input ), expected );
}

License

This project is licensed under the terms of the MIT license.

Copyright (c) 2019 Max Dancau

About

Clean and simple regex implementation of Kölner Phonetik, a soundex-like algorithm for German language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%