Skip to content

Commit d465566

Browse files
committed
removed reverse bool
1 parent c9ac6d3 commit d465566

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

language/movie_nl/main.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,9 @@ def rank_entities(reader, sentiment=None, topn=None, reverse_bool=False):
282282
else:
283283
items.append(entity_item)
284284

285-
items.sort(reverse=True)
285+
items.sort(reverse=reverse_bool)
286286
items = [json.dumps(item[1]) for item in items]
287287

288-
if reverse_bool:
289-
items.reverse()
290-
291288
if topn:
292289
print('\n'.join(items[:topn]))
293290
else:
@@ -340,7 +337,9 @@ def analyze(input_dir, sentiment_writer, entity_writer, sample, log_file):
340337
rank_parser.add_argument(
341338
'--sentiment', help='filter sentiment as "neg" or "pos"')
342339
rank_parser.add_argument(
343-
'--reverse', help='reverse the order of the items')
340+
'--reverse', help='reverse the order of the items', type=bool,
341+
default=False
342+
)
344343
rank_parser.add_argument(
345344
'--sample', help='number of top items to process', type=int)
346345

0 commit comments

Comments
 (0)