mirror of https://github.com/CIRCL/AIL-framework
-v option added to list the path
parent
d89ae365f9
commit
cdd0725e88
|
@ -36,6 +36,7 @@ argParser.add_argument('-n', action='store_true', default=False, help='return nu
|
||||||
argParser.add_argument('-t', action='store_true', default=False, help='dump top 500 terms')
|
argParser.add_argument('-t', action='store_true', default=False, help='dump top 500 terms')
|
||||||
argParser.add_argument('-l', action='store_true', default=False, help='dump all terms encountered in indexed documents')
|
argParser.add_argument('-l', action='store_true', default=False, help='dump all terms encountered in indexed documents')
|
||||||
argParser.add_argument('-f', action='store_true', default=False, help='dump each matching document')
|
argParser.add_argument('-f', action='store_true', default=False, help='dump each matching document')
|
||||||
|
argParser.add_argument('-v', action='store_true', default=False, help='Include filepath')
|
||||||
argParser.add_argument('-s', action='append', help='search similar documents')
|
argParser.add_argument('-s', action='append', help='search similar documents')
|
||||||
|
|
||||||
args = argParser.parse_args()
|
args = argParser.parse_args()
|
||||||
|
@ -84,6 +85,8 @@ with ix.searcher() as searcher:
|
||||||
results = searcher.search(query, limit=None)
|
results = searcher.search(query, limit=None)
|
||||||
for x in results:
|
for x in results:
|
||||||
if args.f:
|
if args.f:
|
||||||
|
if args.v:
|
||||||
|
print (x.items()[0][1])
|
||||||
print (readdoc(path=x.items()[0][1]))
|
print (readdoc(path=x.items()[0][1]))
|
||||||
else:
|
else:
|
||||||
print (x.items()[0][1])
|
print (x.items()[0][1])
|
||||||
|
|
Loading…
Reference in New Issue