Task Overview:You will be creating a solution to transform existing text into their text-based emoji representations, and vice versa. We are providing a text file with the mapping between English and...



Task Overview:

You will be creating a solution to transform existing text into their text-based emoji representations, and vice versa. We are providing a text file with the mapping between English and the emoji character set you are to use for this assignment. Our emoji file uses metadata, so you will need to design your solution to handle that style of data representation.


Note: For this assignment, the first line in the data file is metadata. It describes the columns of data provided. Your program should be flexible enough to work EVEN IF WE GIVE AN ALTERNATE FILE with similar data, as long as the metadata is present.


The metadata line look like this:METADATA ENGLISH WESTERN KAOMOJI

The wordMETADATAindicates that this line is NOT traditional data. The next 3 (or more, if we add more emoji sets) columns describe the sequence of the emoji information in the rest of the file. Therefore, for each line ofthisfont file, English words are in the first column, Western-style emojis are in the second column and Kaomoji-style emojis are in the third column.




Important Note:
As we discussed in lecture, metadata is "data about data". Do NOT rely on the positioning of the columns given here as an example. We will freely move the columns and use different metadata files for this assignment. If you hardcode column positions, your solution will NOT pass our autograder tests!





Design and code the following function:

As part of your solution, you
must
provide the following function:



batch_translate(emoji_file_name:str, directives_file_name:str)



This function takes two strings:
(1) the name of the emoji mapping file (we've given you one with emojis.txt) and
(2) a directives file which gives instructions for the type of transformation to run, and then orchestrates the process of converting the text as specified. Our auto-test suite will call this function to test your solution, so whatever process needs to be initiated to perform the text transformation should be performed when this function is called.




this:



  • a program that translates English words to their Western or Kaomoji equivalents. Use the given emojis.txt as the basis for your translation. This is whole-word replacement, similar to what you accomplished with Homework 5. Unlike that homework, however, you should NOT be stripping punctuation from your finished transformation. We'll be using your transformation program as an automated responder to text messages and to create form letters (think mail-merge) and we need to retain the original punctuation in those messages.



37272126


  • Your program does not require any user interface. Your output must be written to files. Minimal print-outs to the screen are allowed (and appreciated) to indicate that your file processing has completed, or that you've handled an exception of some type. However, we don't want to see paragraphs of text printed out, and certainly noinput()from the keyboard.
    For example, here is our output after processing the directives file



    37272137



  • Your program must read from a text file that gives instructions on the emoji substitution required, the input file to use as the source information AND the output file you should generate for your output. We've included one calledemoji_directives.txtbut your program should be able to handle ANY file we pass it when we call the appropriate function.

    • For example, theemoji_directives.txtstarter file given gives you the transformations you must process in sequence. In one case we are asking for a transformation from English to kaomoji for recommendation_letter.txt. The source file: recommendation_letter.txt is given to you as a starter file. Your code must produce the output file recommendation_letter_k.txt





METADATA ENGLISH WESTERN KAOMOJI
Happy :‑) ^_^
Laugh :‑D >^_^
Angry :‑( (>_<>
Confused :-/ (°.°)
Crying :'( ('_')
ROTFL :') (^_^)v
Disgusted D:<>
Embarrassed :$ (#^.^#)
Sick :‑### `(๑△๑)`*
Cool |;‑) ╰(▔∀▔)╯
Wink ;‑) (^_-)
Innocent O:) (^j^)
Worried :E (-"-)
Surprised :‑O (o.o)
Evil }:‑) (•̀ᴗ•́)و^
Heart<3>
Heartbroken<\3>
Cat =ʘᆽʘ=∫ =^._.^=∫


Nov 12, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here