Guest User

Untitled

a guest
Jul 2nd, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import fuzzywuzzy,os
  2. from fuzzywuzzy import process
  3.  
  4. def get_match(query,choices,limit=1):
  5.     res=process.extract(query,choices,limit=1)
  6.     # l=res
  7.     return res[0][0]
  8.  
  9. if __name__ == "__main__":
  10.     t=int(input())
  11.     for looper in range(t):
  12.         n,q=map(int,input().split())
  13.         d=[]
  14.         for j in range(n):
  15.             st=input()
  16.             d.append(st)
  17.         for k in range(q):
  18.             val=input()
  19.             get_match(val,d)
  20.             print(get_match(val,d))
Add Comment
Please, Sign In to add comment