Module main
source code
The main file parse the command line and run the program in the
desired way.
There's three possible runing options:
-
-c or --cmdl: Run the program using the command line interface (not
really suitable)
-
-g or --gui: Run the program using the graphic user interface.
-
-p or --profile: Simulate the predictions computation for a sample
string and print the profiling statistics for the session. This is
useful to see what part of the program took the largest part of the
program's execution time.
Examples of profiling use:
C{python3 -m cProfile -s time main.py -p '' -l 10}
-> Simulate the input and predction of ten consecutive inputs of the
'hello world' string (default string).
C{python3 -m cProfile -s time main.py -p 'the seasons wither'}
-> Simulate the input and predction of the 'the seasons wither'
string.
Notes:
-
You must specify your own test string after -p or --profile, if
none are specified a default one will be used.
-
The option -l or -loop indicate how many times the profiling
operation have to be carried out.
To Do (0.1.0):
Add memoize classes and decorators to improve performance.
|
|
run_profile(string='hello world')
Initialize the Driver instance and start a cmdl REP loop. |
source code
|
|
|
|
run_cmdl()
Initialize the Driver instance and start a cmdl REP loop. |
source code
|
|
|
|
run_gui()
Initialize the Driver instance and run the gui. |
source code
|
|
|
|
|
|
|
|
|
|
CONFIG_FILE = 'profile.ini'
Path of the config .ini file to use, if empty a default config will
be used
|
|
The main function of the program.
Take care of the command line options and run the program (gui or
command line) or print the help.
|