I'm trying to set up a morse code-english converter by prompting the user for morse-->english translation or english--> morse translation, prompting the user to enter the text to be translated, and then finally translating it. So far, I've been able to do english-->morse code translations because that just involves encoding each individual letter. I'm having trouble with morse-->english translations though because that doesn't just involve decoding each individual character. The problem I'm having is I don't want the program to convert each individual dash and period to a letter, but rather a
string of dashes and periods to a letter (..-. = f). I also want "|" to separate each
word in morse code. For example, if morse code input is "-- -.-- | -. .- -- ." then translated output should be "my name". I implemented this successfully in the stringToMorse() method, but I don't know how I would do it in the stringToEnglish() method. Any ideas are appreciated.