Background
Dory suffers from short term memory loss. Telephone numbers are one of the greatest mysteries to her.Whenever she wants to call her friend Marlin she discovers that she can hardly remember his name. Because words are not that hard (she can even speak foreign languages) we should help her in translating phone numbers to words.
We want to use a mapping for encoding telephone numbers by words, so that it becomes easier to remember the numbers.
Problem
The following mapping from letters to digits is given:
E JNQ RWX DSY FT AM CIV BKU LOP GHZ
e jnq rwx dsy ft am civ bku lop ghz
0 1 2 3 4 5 6 7 8 9
Your task is writing a program that finds, for a given phone number, all possible encodings by words,and prints them sorted in alphabetical/lexicographical order. A phone number is an arbitrary(!) string of dashes - , slashes / and digits. The dashes and slashes will not be encoded. The words are taken from a dictionary which is given as an ASCII file (one word per line). Every encoding that is possible from this dictionary and that matches the phone number exactly shall be printed. The words in the dictionary contain letters (capital or lowercase), dashes - and double quotes " . For the encoding only the letters are used, but the words must be printed in exactly the form given in the dictionary. Leading non-letters do not occur in the dictionary. Encodings of phone numbers can consist of a single word or of multiple words separated by spaces.