Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from nltk.corpus import wordnet as wn
- # print(wn.synsets("ứa_nước_miếng"))
- def test_db_file(index_files):
- limit = 30
- count = 0
- for inde_file in index_files:
- listLine = [i.strip() for i in open(inde_file, 'r').readlines()]
- for line in listLine[30:]:
- tmpList = line.strip().split()
- # print(line)
- # vv = wn.synsets(tmpList[0].replace('_', '_'))
- try:
- vv = wn.synsets(tmpList[0].replace('_', '_'))
- except Exception as error:
- print ("loi o:", line)
- print(error)
- print("--------------------------------")
- count += 1
- if limit == count:
- break
- INDEX_FILES = ["data/index.noun.replaced.grouped.final"]
- test_db_file(INDEX_FILES)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement