Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import fuzzywuzzy,os
- from fuzzywuzzy import process
- def get_match(query,choices,limit=1):
- res=process.extract(query,choices,limit=1)
- # l=res
- return res[0][0]
- if __name__ == "__main__":
- t=int(input())
- for looper in range(t):
- n,q=map(int,input().split())
- d=[]
- for j in range(n):
- st=input()
- d.append(st)
- for k in range(q):
- val=input()
- get_match(val,d)
- print(get_match(val,d))
Add Comment
Please, Sign In to add comment