Write a structured (procedural) Python program that solves the following spec: Soundex System Coding: Soundex is a system that encodes a word into a letter followed by three numbers that roughly describe how the word sounds. Therefore, similar sounding words have the same four-character code. Use the following set of (slightly modified #4) rules to create a translator from English words to Soundex Code: 1. Retain the first letter of the word. 2. For letters 2 .n, delete any/all occurrences of the vowels (3,elo.u), h, w, y. 3. Assign the following numbers to any remaining letters in the word a. 1 for occurrences of B, F, P, V. b. 2 for occurrences of C, G, J, K, Q, S, X, z C. 3 for occurrences of D, T d. 4 for L e. 5 for M, N f. 6 for R 4. For repeated numbers, remove the repeats ("PROGRAMMING" → P6265552 → P62652) 5. Keep only the first four characters of what you have left (P62652 → P626) However, if you have less than 4 characters, O fill the empty spots so that ALL words have 4-character soundex codes. (e.g. "Anita" → AS3→ A530)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a structured (procedural) Python program that solves the following spec:
Soundex System Coding: Soundex is a system that encodes a word into a letter followed by three
numbers that roughly describe how the word sounds. Therefore, similar sounding words have the same
four-character code. Use the following set of (slightly modified #4) rules to create a translator from
English words to Soundex Code:
1. Retain the first letter of the word.
2. For letters 2 .n, delete any/all occurrences of the vowels (3,elo.u), h, w, y.
3. Assign the following numbers to any remaining letters in the word
a. 1 for occurrences of B, F, P, V.
b. 2 for occurrences of C, G, J, K, Q, S, X, z
C. 3 for occurrences of D, T
d. 4 for L
e. 5 for M, N
f. 6 for R
4. For repeated numbers, remove the repeats ("PROGRAMMING" → P6265552 → P62652)
5. Keep only the first four characters of what you have left (P62652 → P626) However, if you have
less than 4 characters, O fill the empty spots so that ALL words have 4-character soundex codes.
(e.g. "Anita" → AS3→ A530)
Transcribed Image Text:Write a structured (procedural) Python program that solves the following spec: Soundex System Coding: Soundex is a system that encodes a word into a letter followed by three numbers that roughly describe how the word sounds. Therefore, similar sounding words have the same four-character code. Use the following set of (slightly modified #4) rules to create a translator from English words to Soundex Code: 1. Retain the first letter of the word. 2. For letters 2 .n, delete any/all occurrences of the vowels (3,elo.u), h, w, y. 3. Assign the following numbers to any remaining letters in the word a. 1 for occurrences of B, F, P, V. b. 2 for occurrences of C, G, J, K, Q, S, X, z C. 3 for occurrences of D, T d. 4 for L e. 5 for M, N f. 6 for R 4. For repeated numbers, remove the repeats ("PROGRAMMING" → P6265552 → P62652) 5. Keep only the first four characters of what you have left (P62652 → P626) However, if you have less than 4 characters, O fill the empty spots so that ALL words have 4-character soundex codes. (e.g. "Anita" → AS3→ A530)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education