00:07:14 Good Morning: And also how to remove accents:) 00:08:39 Yigit Oztekin: can you expla 00:09:04 Yigit Oztekin: can you explain the hw basically bc its hard to understand for me just by reading it 00:09:11 Yigit Oztekin: sorry i accidentally pressed enter there 00:09:17 marta costantini: Does the recovery homework have a deadline? 00:09:30 Dario Loi: every strange character like ø must correspond to its similar latin alphabeth character regardless of pronunciation? (in this example ø -> o)? 00:10:01 marta costantini: Ok thank you 00:10:48 Dario Loi: so all those other symbols we can just delete them? 00:10:49 Yigit Oztekin: and why is j and y considered vowels? 00:11:05 Dario Loi: there are in the random.txt files 00:11:37 Alessio Borgi: Therefore we have to delete these strange vowels? I'm reffering to the ones with point above and so on 00:12:54 Good Morning: Without importing other libraries? 00:15:51 Good Morning: Wait the differences between upper and lower are relevant or not? 00:16:19 Good Morning: okok 00:16:58 Federica Valeau: So can we ignore these accents( ã ă â e ê ĩ õ ô ơ ũ ư y ý ỳ ) and just cancel these letters? 00:17:19 Angelo Spognardi: NO: you have to TRANSFORM accented letters to plain letters 00:18:11 Federica Valeau: Okay thanks 00:18:41 Alessio Borgi: I don't understand the exception referring to the first and the last SE. 00:21:57 Alessio Borgi: Thank you 00:26:32 benjamin barda: all the verse must be included in the schema ? 00:26:49 Good Morning: great 00:32:13 Angelo Spognardi: hello? 00:32:14 benjamin barda: all clear 00:32:16 Federica Valeau: How can we make a computer recognize a sequence? 00:32:30 benjamin barda: my question is about the accents 00:32:36 Davide Marincione: well, we in the class can't talk... sorry 00:32:40 Federica Valeau: like the sequence of verses 00:33:12 Giordano Cenciarelli: don't we need a list of all the special character used in the txt.file? 00:34:15 Federica Valeau: Okay ,got it 00:36:51 benjamin barda: yes 00:38:19 benjamin barda: but that is a zero with a bar 00:38:23 Dario Loi: since the leaderboard's codes are visible to everyone now, could we analyze some of the better implementations to learn what were the best ways to approach the problem? 00:38:38 Dario Loi: regarding ex2 00:38:39 Davide Marincione: is there a list of the characters we have to look up for? like are digits there? 00:39:37 Davide Marincione: right, we'll have to make some tests on the tests then 00:40:48 Yigit Oztekin: uh yeah a little better 00:40:59 Yigit Oztekin: hahaha sorry I'm slow 00:43:13 Dario Loi: there was an OOP implementation 00:43:20 Dario Loi: In the first in efficiency 00:46:35 Dario Loi: yes my program also had an implementation like this 00:49:16 Good Morning: Yep sure 00:49:25 Emanuele Segatori: Crystal clear 00:49:29 Dario Loi: I brought up that program not for the OOP implementation in itself, but also because it had cool concepts, like not counting the letters that were worth 1 00:49:46 Dario Loi: okay 00:51:17 Carlo Giuseppe Tomazzoli: (I used objects just to keep track of players stats and order.) 00:51:38 Dario Loi: sadly we have courses during those hours 00:51:43 Dario Loi: but thanks 00:52:02 Dario Loi: no we don't 00:52:14 Ginevra Cepparulo: we are free all thursday 00:52:16 Dario Loi: I heard friday sorry :/ 00:53:08 Dario Loi: okay, thanks 00:58:52 Giuseppina Iannotti: with open(filename.txt) as f: 01:00:40 Good Morning: Open file, join file in order to get rid of newline and spaces. Now we have a ‘very huge big-no sense word’. Create a string alphabet ‘abcd..’. For char in alphabet: tot+=‘very huge no-sense string’.count . Create the dictionary 01:02:03 Good Morning: .count(char) 01:02:12 Simone Cargnin: nice 01:04:10 Good Morning: Yep sure 01:05:16 Gabriele Scognamiglio: Does strip have a key ? 01:05:32 Ginevra Cepparulo: What if we use isalnum.() method 01:05:52 Simone Cargnin: use replace() 01:07:24 Good Morning: Maybe(?) f= open(file), string=f.readlines(), text=(‘’)Join .Map (str.strip, f) 01:07:55 Good Morning: Maybe(?) f= open(file), string=f.readlines(), text=(‘’)Join .Map (str.strip, string)* 01:08:44 Good Morning: This is only to remove newline 01:09:57 Francesco Danese: sorry what about splitlines() method? It returns a list of the lines 01:13:54 Good Morning: perfect 01:14:32 Ginevra Cepparulo: what is we use a list comprehension with the isalnum() method to remove all special characters 01:14:41 Ginevra Cepparulo: *if 01:20:22 benjamin barda: yes 01:20:26 andry ambinintsoa randrianantoandro: yes 01:20:26 Tommaso Di Mario: All clear 01:20:27 Gabriele Scognamiglio: yes 01:20:27 Yigit Oztekin: yes 01:20:32 Alessio Borgi: Yes all clear 01:22:42 Ginevra Cepparulo: a dictionary 01:24:14 Oleksandr Prusakovskyy: for char in alpha: 01:24:37 Oleksandr Prusakovskyy: only_chars.count(char) 01:24:48 Good Morning: Yep sure I did only a ‘scaletta’ in order to reason together better on the problem 01:25:31 Good Morning: Creating the string alphabet you only have to loop 26 times instead of len(text) 01:27:01 Good Morning: right 01:29:10 Ginevra Cepparulo: What if you combine the idea and if the char is already int he dictionary you count the occurrences of the character and add it to the dictionary 01:31:14 Good Morning: yep 01:31:49 Tommaso Di Mario: What about something like dic = {c: string.count(c) for c in set(string)} 01:38:09 Simone Cargnin: use the bult in variable 01:38:15 Simone Cargnin: *built 01:38:31 Simone Cargnin: for the alphabet 01:39:08 Simone Cargnin: isn't it faster? 01:40:33 Good Morning: yep 01:40:36 Ginevra Cepparulo: yes 01:42:34 Good Morning: sorted 01:46:48 Simone Cargnin: maybe I have an other type of solution 01:46:59 Simone Cargnin: but I don't know if it work 01:47:08 Simone Cargnin: and it return a list of tuple 01:48:25 Simone Cargnin: just use the command c=Counter(the_big_string).most_common() 01:57:52 Simone Cargnin: i saw on python documentation let me check 01:58:44 Simone Cargnin: collections 02:00:43 Good Morning: 26*len(string) 02:01:53 Good Morning: If..elif*25 02:02:48 Simone Cargnin: will this take less time? 02:02:51 andry ambinintsoa randrianantoandro: only once 02:04:00 Emanuele Segatori: I think that counting every character is faster than check an if for each 02:04:08 Davide Marincione: it's because count is written in C 02:04:25 Alessio Borgi: dic[char] = dic.get(char, 0) +1? 02:04:37 Good Morning: Yep it’s the same 02:04:38 Andrea Caminiti: what if we do something like dic[char]= dic.get(char, 0) +1 after the for instead 02:05:50 Carlo Giuseppe Tomazzoli: initialize the dic with the fromkeys method, defaults to zero, remove else clause 02:08:46 Good Morning: /len(string) 02:09:00 andry ambinintsoa randrianantoandro: dic[char]/ len(string) for all chars? 02:11:35 Good Morning: Or maybe directly in the def good morning we can do string.count(char)/len(string) 02:12:13 Good Morning: Ah yes of course 02:14:10 Good Morning: Files = [Alice.txt, …] 02:14:10 Ginevra Cepparulo: dictionary comprehension 02:14:22 Good Morning: For i in range 4 02:15:32 Good Morning: dic={}, dic[I]= def(with.items inside) 02:15:35 Ginevra Cepparulo: {x: {book1 : book1[x], book2: book2[x]…} for x in “abcde..”} 02:16:43 Good Morning: We create the list of tuple inside the def by using .items and we apply this def to each text file 02:19:30 Good Morning: I’m lost 02:19:55 Good Morning: ahhhhh 02:23:32 Ginevra Cepparulo: first maybe you can create a dictionary with each letter as key and as a value an empty dictionary 02:24:10 andry ambinintsoa randrianantoandro: we can make a for loop inside a for loop. The first for loop goes through all characters (so the keys of any book), and the nested for loop goes through each book 02:26:05 Ginevra Cepparulo: For book in book list 02:30:03 Oleksandr Prusakovskyy: Clear 02:30:05 andry ambinintsoa randrianantoandro: yes all clear 02:30:09 Francesco Danese: why we need the first statement? (dic = {….}) 02:31:07 Good Morning: bookfile_list is the same of book_list? 02:33:17 Good Morning: I’m lost 02:35:25 Good Morning: Got it 02:38:48 Good Morning: yep 02:38:57 Ginevra Cepparulo: Makes sense 02:38:57 Federica Valeau: okay 02:39:04 Simone Cargnin: ok 02:41:34 Nicholas Tiveron: It's called Zipf law 02:46:25 Dario Loi: no 02:46:27 Ginevra Cepparulo: No 02:46:28 dennis locatelli: nope 02:46:30 Benedetta Sampaolo: all clear 02:46:32 andry ambinintsoa randrianantoandro: All clear for me 02:46:40 Good Morning: How to remove accents :) 02:46:40 Simone Cargnin: you're right 02:47:02 Good Morning: Ok :( 02:47:23 Simone Cargnin: bye 02:47:48 Federica Valeau: Sir do you know where the lessons will be next week? 02:47:48 Ginevra Segafredo: Thank you Professor. Have a nice weekend! 02:47:49 Gabriele Scognamiglio: Thank u bye 02:47:49 Benedetta Sampaolo: thank you, bye 02:47:50 ISRAT JAHAN MITU: Thank you for the lecture! 02:47:53 Good Morning: Enjoy your weekend too! 02:47:55 Ginevra Cepparulo: See you on Wednesday 02:47:57 Nicholas Tiveron: Thanks, bye! 02:47:58 lisa tozzi: thanks bye 02:47:58 Martina Fasiello: thank you, bye 02:47:58 Davide Loriga: bye bye 02:47:59 Paolo Gigliesi: goodbye, thank you! 02:47:59 Giuseppina Iannotti: Thanks,bye 02:48:00 Alessio Borgi: Bye 02:48:00 dennis locatelli: bye 02:48:02 Dario Loi: bye thanks 02:48:02 Federica Valeau: good bye