-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine.py
53 lines (37 loc) · 882 Bytes
/
engine.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
Functionality for the Aeolia engine.
"""
import sys
import getopt
import nltk
import spacy
import corpus.model
class Cmdline:
"""
Parses the command line for input.
"""
def __init__(self, argv):
self.__file = ''
try:
opts = getopt.getopt(argv, "hi:", ["input=",])
except:
self.__show_help()
for opt, arg in opts:
if opt == "-h":
self.__show_help()
elif opt in ("-i", "--input",):
self.__file = arg
else:
self.__show_help()
@staticmethod
def __show_help():
"""
Shows the default help message.
"""
print("./engine.py -i <input-file>")
sys.exit(2)
def input_file(self):
"""
Gets the parsed input file.
"""
return self.__file