chg: [readable] add span description (token/word queried)

This commit is contained in:
Alexandre Dulaunoy 2020-10-11 11:38:06 +02:00
parent 42e3094489
commit 5fe2e2ae1f
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -134,17 +134,20 @@ for entity in doc.ents:
if args.o == "json":
output_json = {"format":"napkin"}
for anal in analysis:
more_info = ""
if args.analysis == "all" or args.analysis == anal:
pass
else:
continue
if anal == "span":
more_info = "for {}".format(args.token_span)
if args.o == "readable":
previous_value = None
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
if args.o == "csv":
print()
elif args.o == "readable":
header = ["\033[1mTop {} of {}\033[0m".format(args.t, anal)]
header = ["\033[1mTop {} of {} {}\033[0m".format(args.t, anal, more_info)]
readable_table = []
elif args.o == "json":
output_json.update({anal:[]})