-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecktest.py
More file actions
executable file
·30 lines (24 loc) · 703 Bytes
/
checktest.py
File metadata and controls
executable file
·30 lines (24 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
'''Test checker cache.'''
from cProfile import run
from opentaal import Checker
def test(filename):
print(filename)
progress = 0
with open(filename) as file:
for line in file:
word = line[:-1]
checker.check(word)
checker.suggest(word)
checker.check(word)
checker.suggest(word)
progress += 1
if progress % 500 == 0:
print(progress)
if progress == 4000:
break
def main():
test('../opentaal-wordlist/elements/flexies-ongekeurd.txt')
test('../opentaal-wordlist/elements/corrections.tsv')
checker = Checker()
run('main()')