Soundex algorithm in Python (homework help request)

前端 未结 3 482
不知归路
不知归路 2020-12-11 14:12

The US census bureau uses a special encoding called “soundex” to locate information about a person. The soundex is an encoding of surnames (last names) based on the way a su

3条回答
  •  悲&欢浪女
    2020-12-11 14:41

    I would suggest you try the following.

    • Store a CurrentCoded and LastCoded variable to work with before appended to your output
    • Break down the system into useful functions, such as
      1. Boolean IsVowel(Char)
      2. Int Coded(Char)
      3. Boolean IsRule1(Char, Char)

    Once you break it down nicely it should become easier to manage.

提交回复
热议问题