Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

Misunderstandings HW4rec

A
Alessandro Vecchi (1870 points)
1 10 18
in HW4 2nd chance by (1.9k points)
Good evening everyone,

I'm struggling to understand the meaning of some stuffs in the hw4rec.

1. How to manage the fact that a greek word can have multiple English translations. I mean, since each English word has exactly an Italian translation I thought that only one of this translations should be right (for right I mean that is present in the Italian translation). Indeed I did a function that gives all the permutations of the translated words in order to choose the right permutation. However I found that if the n italian translations of the same greek word are in the Italian text then we should consider all of them(from a greek word I have n new Italian words how on earth(?)) ex. 'molto' 'eccessivamente' text 6.

2. How to manage the short words. Maybe I misread the text (I read it at least 10 times) but there is nothing related to the length of a word. So each word of lenght>0 should be fine. Great. But if the Italian translation of a greek word is for example an 'in' or an 'e(and)' and k is equal to 1 why they are not in the solutions?? They are both present as word(' e ') and as string so they should be surely considered in the final set from my point of view. ex. text6 and also others

sorry to bother you but I really need these answer since I can't write the final part of the hw well if I don't understand how these things work
255 views
closed

1 Answer

Best answer
by (2.8k points)
selected by

Good morning!

Thanks for your remarks and observations. Let’s see if we can help to clarify these matters.

  1. Notice that test6 has a couple of sneaky details. One of those is that it looks for sequences of at least… one word. So, any translation is suitable (aside from subsequences: single words do not count if they are inside a longer sequence). For example, μάλα translates to “very” (→ “molto”) and “exceedingly” (→ “eccessivamente”). We happen to read “μάλα” in odyssey.txt in paragraph 1 and both “molto” and “eccessivamente” in proemio.txt, in two different spots of paragraph 2. Hence, both (('μάλα', 1), ('molto', 2)) and (('μάλα', 1), ('eccessivamente', 2)) belong to the result.
  2. Right: the length of the words plays no role here. Here comes the second sneaky detail of test6 though, which might have caused the doubt: we do not pass lexicon-GR-EN.csv and lexicon-EN-IT.csv as arguments but lexicon-GR-EN_.csv and lexicon-EN-IT_.csv in their stead, respectively. Notice that “καί” is missing in lexicon-GR-EN_.csv. If we had used lexicon-GR-EN.csv and lexicon-EN-IT.csv, occurrences of “e” (← “and”) would have been considered.
I hope this helps. I take the chance for a reminder: please make sure to play with the latest version of the ZIP file, uploaded yesterday (we cleansed the CSV files to avoid that a single Greek word showed the same translation twice in a row – e.g., ‘γῆρας;old age;old age’). Nothing that changes the final results, but just to avoid further misunderstandings.
I hope this helps.

With kind regards,
CDC
A
Alessandro Vecchi (1870 points)
1 10 18
by (1.9k points)
Great, thank you for your reply. I didn't noticed that the dictionaries files were different and I really thought that I should only choose one of the possible Italian translations for a greek word. I have to review my code. Thanks again for your availability. If I have any more questions, I'll write here.