mirror of
https://github.com/adulau/napkin-text-analysis.git
synced 2024-11-24 02:47: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":
|
||||
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:[]})
|
||||
|
|
Loading…
Reference in a new issue