Programming Homework Help

Programming Homework Help. How to use a dictionary to translate in Haskell?

You are not allowed to use any imports.

Program the function, which has the type Translate :: String -> String. This function takes in a word or expression. You will use the dictionary given. if the word is not in the dictionary an empty string returns.

Every element in the dictionary is of the type (String, [String])

Example on how it should look

Translate “bb” = “Big Brother”

Translate “sector” = “sec”

After that you want to use this translation to check how many characters have been changed in a translated text, to make the problem easier you can just count the number of characters from the original text which arent in the translated text. The type for this function is Analytics :: String -> String -> Int. The percantage is to be given to the nearest whole number and you use this formula to calculate it : 100 * (<number of changed characters> / <length of original string>)

Example: analytics «excellent work» «doubleplusgood work» = 43

Example: analytics «great job» «great job» = 0

Programming Homework Help

 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"