can sumone help me with a program that reads in a normal text file and converts it into mobile phone text. that is if the word is 3 characters or less then ther is no changes to the word and if the word is four or more letters then remove all the vowels from the word except for vowels that are capitals
I am getting no errors or warnings but also ther is no output. am i missing something???
Also is it possible to have a dictionary of commonly used abbreviations that will be used to replace the normal text like gr8 for great, 2mro for tomorrow. That is only to populate the dictionary with a few words..
The program looks correct. how does the input file looks like ?
for the dictionary, you can put words in an file and when the program starts, read that file in a map. the map will be a pair of sequence of text you see and the replacement for those. for example a pair of great and gr8. That is the easiest.
thank u for your reply will surely use code tags next time..
well regarding input file are you talking abt the header file??bcuz i am using only this single file and it generates no errors but does not display any output??
did u run the program and had similar problem???
and abt dictionary i am really confused as i am not able to get it. could you plz show be one example like great-g8, i'll have an idea as how to use it and implement on others..
i am really sorry for the series of doubts but would really appreciate your help as i am stuck at it for a very long time and need to submit the work soon.
Thank you for your efforts.
you have no error checking for this. so, if this file is not found, you will get nothing. put an error in the else if this file is not found or cannot be opened. This is what must be happening.
a dictionary can be like this:
//dictionary.txt
great gr8
tomorrow 2mro
now, you can read this file in a std::map (read about std::map, if you dont know). they are data structure of key value pairs. this means, if you give them a key (great), they will return its value (gr8). so, you can check your string for these words and keep on substituting with short forms.
you can use std::algorithms search algorithms to find strings inside your input files.
as a beginner, I would suggest you implement them yourself which will give you a good idea and understanding. read about searching patterns like Knuth–Morris–Pratt and others.