@@ -287,7 +287,7 @@ def most_active_user(input_file):
287287 try :
288288 graph = GraphRepresentation .build_graph (input_file )
289289 user = NetworkAnalysis (graph ).get_most_active_user ()
290- print (f"{ Fore .GREEN } Most active user(s):" ,* user )
290+ print (f"{ Fore .GREEN } Most active user(s) ID(s) :" ,* user )
291291 except Exception as e :
292292 print (f"{ Fore .RED } Error finding most active user: { e } " )
293293
@@ -363,14 +363,18 @@ def search_posts(input_file, word=None, topic=None):
363363 print (f"{ Fore .LIGHTYELLOW_EX } You forgot to add the extension to the input file :) \n Appending '.xml' to the input file name." )
364364 try :
365365 searcher = PostSearch (input_file )
366- if word :
367- results = searcher .search_word (word )
368- print (f"{ Fore .GREEN } Posts containing the word '{ word } ':" )
366+ if word and topic :
367+ results = searcher .search_word_topic (word , topic )
368+ print (f"{ Fore .GREEN } Posts containing the word '{ word } ' and related to the topic ' { topic } ' :" )
369369 print (* results , sep = "\n " )
370370 elif topic :
371371 results = searcher .search_topic (topic )
372372 print (f"{ Fore .GREEN } Posts related to the topic '{ topic } ':" )
373373 print (* results , sep = "\n " )
374+ elif word :
375+ results = searcher .search_word (word )
376+ print (f"{ Fore .GREEN } Posts containing the word '{ word } ':" )
377+ print (* results , sep = "\n " )
374378 except Exception as e :
375379 print (f"{ Fore .RED } Error searching posts: { e } " )
376380
0 commit comments