-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathranking_algo.text
More file actions
34 lines (21 loc) · 787 Bytes
/
ranking_algo.text
File metadata and controls
34 lines (21 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//Sudo code for the ranking algorithm
-(NSDict) compare(list of other users, user_object){
//removes the first letter if it's a space
for word in mywords:
if word[0] == " ":
current keyword = [string substringFromIndex:1]
//compares the user to
dict_ranking = {"USER_ID": rank, "USER_ID": rank}
for each_keyword in our_user_list:
for each_object in database:
other_person_array = StringToArray(each_object.keyword());
for each_person_keyword in other_person_array:
if each_keyword == other_person_keyword:
dict_ranking[USER_ID] += 1;
}
-(NSArray) StringToArray(NSString keywords){
//Takes a string
NSString *myString = keywords;
//separates it into keywords by commas
NSArray *myWords = [myString componentsSeparatedByString:@","];
}