mirror of
https://github.com/adulau/napkin-text-analysis.git
synced 2024-11-24 10:57:07 +00:00
chg: [readable] add span description (token/word queried)
This commit is contained in:
parent
42e3094489
commit
5fe2e2ae1f
1 changed files with 4 additions and 1 deletions
|
@ -134,17 +134,20 @@ for entity in doc.ents:
|
||||||
if args.o == "json":
|
if args.o == "json":
|
||||||
output_json = {"format":"napkin"}
|
output_json = {"format":"napkin"}
|
||||||
for anal in analysis:
|
for anal in analysis:
|
||||||
|
more_info = ""
|
||||||
if args.analysis == "all" or args.analysis == anal:
|
if args.analysis == "all" or args.analysis == anal:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
if anal == "span":
|
||||||
|
more_info = "for {}".format(args.token_span)
|
||||||
if args.o == "readable":
|
if args.o == "readable":
|
||||||
previous_value = None
|
previous_value = None
|
||||||
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
|
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
|
||||||
if args.o == "csv":
|
if args.o == "csv":
|
||||||
print()
|
print()
|
||||||
elif args.o == "readable":
|
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 = []
|
readable_table = []
|
||||||
elif args.o == "json":
|
elif args.o == "json":
|
||||||
output_json.update({anal:[]})
|
output_json.update({anal:[]})
|
||||||
|
|
Loading…
Reference in a new issue