GY-63_MS5611/libraries/Soundex
2022-02-06 16:08:32 +01:00
..
.github/workflows 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
examples 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
test 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
.arduino-ci.yml 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
keywords.txt 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
library.json 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
library.properties 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
LICENSE 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
README.md 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
Soundex.cpp 0.1.1 Soundex 2022-02-06 16:08:32 +01:00
Soundex.h 0.1.1 Soundex 2022-02-06 16:08:32 +01:00

Arduino CI Arduino-lint JSON check License: MIT GitHub release

Soundex

Arduino Library for calculating Soundex hash.

Description

This library generates a (string based) hash based upon how a word sounds. This algorithm is called Soundex. The original algorithm was developed by Robert C. Russell and Margaret King Odell over 100 years ago. There are several variations of Soundex and these might be supported in the future.

The algorithm roughly copies the uppercase first letter of the word, followed by 3 digits replacing the consonants.

The base Soundex has 26 x 7 x 7 x 7 = 8918 possible outcomes, this could be encoded in an uint16_t.

Interface

Use #include "Soundex.h"

  • Soundex() Constructor.
  • void setLength(uint8_t length = 4) Sets the length to include more digits. max length = 11
  • uint8_t getLength() returns current length.
  • char * soundex(const char * str) determines the (Russell & Odell) Soundex code of the string.

Performance

Not tested ESP32 (and many other platforms) yet. First numbers of .soundex(str) measured with test sketch shows the following timing per word.

Checksum digits UNO 16 MHz ESP32 240 MHz
Soundex 3 32 us

Operation

See examples.

Future ideas

  • more testing
    • other platforms
    • different key lengths
    • string lengths
    • performance
  • numeric version of Soundex
    • store in an uint16_t (bit fields 5,3,4,4)
    • uint16_t soundexN(const char * str).
  • efficient storage of the Soundex array
    • encode in nibbles. (13 bytes instead of 26) => more code, performance? 0x01, 0x23, 0x01 etc.
  • Other algorithms might be added in the future.
    • Daitch<96>Mokotoff Soundex
    • Beider-Morse Soundex
    • Metaphone