Browse Source

Finished ui and added shebang

cache_money
Raphael Roberts 7 years ago
parent
commit
63bbd51837
  1. 14
      main.py

14
main.py

@ -1,3 +1,4 @@
#!/usr/bin/python
import re
import itertools
from spellchecker import SpellChecker
@ -14,3 +15,16 @@ def canidates(letters, min=2, max=5):
def filter_pos(pos, regex):
pat = re.compile(regex)
return list(filter(pat.match,pos))
while True:
letters = input('Enter letters: ')
pos = canidates(letters)
inp = None
while inp not in (":quit:",":new:"):
if inp is not None:
for word in filter_pos(pos, inp):
print(word)
prompt = "Enter pattern, ':new:' for new letters, or ':quit:' to exit: "
inp = input(prompt)
if inp == ":quit:":
break
Loading…
Cancel
Save