Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
pp:project2021 [2022/05/11 10:55] vbadoiu |
pp:project2021 [2022/05/11 18:45] (current) dmihai [3.6 Typos (1p)] |
||
---|---|---|---|
Line 379: | Line 379: | ||
We want to check the similarities between users’ hours slept. | We want to check the similarities between users’ hours slept. | ||
- | * For that, we want to obtain a graph where "From" and "To" are users’ emails and "Value" is the distance between the 2 users’ hours slept. | + | * For that, we want to obtain a graph where "From" and "To" are users’ names and "Value" is the distance between the 2 users’ hours slept. |
- | * We define the distance between user1 and user2 as "the sum of intervals where they both slept a equal amount" (e.g. same value for "10" in `eight_hours`). Keep only the rows with ''distance >= 5''. | + | * We define the distance between user1 and user2 as "the sum of intervals where they both slept a equal amount" (e.g. same value for "10" in ''eight_hours''). Keep only the rows with ''distance >= 5''. |
* The edges in the resulting graph (the rows in the resulting table) should be sorted by the "Value" column. If email is missing, don't include that entry. | * The edges in the resulting graph (the rows in the resulting table) should be sorted by the "Value" column. If email is missing, don't include that entry. | ||
**Task 3.5.**: Your task is to write ''similarities_query'' as a **sequence of queries**, that once evaluated results in the graph described above. | **Task 3.5.**: Your task is to write ''similarities_query'' as a **sequence of queries**, that once evaluated results in the graph described above. | ||
- | The input table is `eight_hours`. | + | The input table is ''eight_hours''. |
**Note**: ''similarities_query'' is a Query. The checker applies ''eval'' on it. | **Note**: ''similarities_query'' is a Query. The checker applies ''eval'' on it. | ||
Line 402: | Line 402: | ||
Your job is to fix the typos in ''email_map'' table, generate the correct table and then use that to join the information about user’s stats. | Your job is to fix the typos in ''email_map'' table, generate the correct table and then use that to join the information about user’s stats. | ||
- | ==== 3.6 Typos (1p) ==== | + | ==== 3.6 Typos (0.4p) ==== |
Column ''Name'' from table ''email_map'' contains typos. Example: //Zane Kayle// is misspelled as //Zan Kayle// or //Amelia Caden// is misspelled as //Amelia Camdden//. Fortunately, the name //Zane Kayle// contains only a few misspelled letters and it is guaranteed to appear in the correct form, in the name column of the ''8h sleep'' or ''physical_activity_in_a_day'' tables. Hence, we can use the latter names as **reference** to correct the typos. | Column ''Name'' from table ''email_map'' contains typos. Example: //Zane Kayle// is misspelled as //Zan Kayle// or //Amelia Caden// is misspelled as //Amelia Camdden//. Fortunately, the name //Zane Kayle// contains only a few misspelled letters and it is guaranteed to appear in the correct form, in the name column of the ''8h sleep'' or ''physical_activity_in_a_day'' tables. Hence, we can use the latter names as **reference** to correct the typos. | ||
Line 410: | Line 410: | ||
<code haskell> | <code haskell> | ||
- | correct_table :: String -> CSV -> CSV -> CSV | + | correct_table :: String -> Table -> Table -> Table |
- | -- this will be tested using: correct_table "Nume" email_map_csv hw_grades_csv | + | -- this will be tested using: correct_table "Nume" emails physical_activity |
</code> | </code> | ||