harshithakr commited on
Commit
e7f2fe8
·
1 Parent(s): 8bc29c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -11,9 +11,11 @@ def get_output(event_info):
11
  if len(event_info.split(' '))>=20:
12
  topic_name, distance_name,topic_name_dep, distance_name_dep,tags_list = get_mapping(event_info)
13
  if distance_name!=None:
14
- sectors = topic_name + topic_name_dep
15
- sectors = [re.split(r'[ _]', x) for x in sectors]
16
  flattened_list = [item for sublist in sectors for item in (sublist if isinstance(sublist, list) else [sublist])]
 
 
17
  print(flattened_list, tags_list)
18
  others = [x for x in tags_list if x not in flattened_list]
19
 
 
11
  if len(event_info.split(' '))>=20:
12
  topic_name, distance_name,topic_name_dep, distance_name_dep,tags_list = get_mapping(event_info)
13
  if distance_name!=None:
14
+ sectors_main = topic_name + [topic_name_dep]
15
+ sectors = [re.split(r'[ _]', x) for x in sectors_main]
16
  flattened_list = [item for sublist in sectors for item in (sublist if isinstance(sublist, list) else [sublist])]
17
+ flattened_list.extend([x.strip().replace(' ','_') for x in sectors_main])
18
+ flattened_list = [ x.strip() for x in flattened_list if x!='']
19
  print(flattened_list, tags_list)
20
  others = [x for x in tags_list if x not in flattened_list]
21