fc1bec1478
Updated the JSON generator to output JSON that the main program can read.
glm942020-07-26 00:40:36 -05:00
fac2b2d625
Refactored some code to try and make it more inline with best pratices. Renamed parser as it conflicted with a standard Python library.
glm942020-07-26 00:25:09 -05:00
a1c260d0fa
A quick and hacky fix for main.py to make use of the new Parser object. Also, switched back to using a JSON file for input, can easily be swapped back though.
glm942020-07-24 11:15:47 -05:00
3cab3f03e8
Updated syntax tree to support variables in the espression.
glm942020-07-01 22:15:25 -05:00
503b16ec65
Cleaned up the AST code and updated the calc_engine code.
glm942020-07-01 21:40:18 -05:00
fcd0076891
Updated the tokenizer to use a deque object instead of a list. The old calc_engine should still work, not tested. New parser code works with this change.
glm942020-07-01 19:28:09 -05:00
212f3bfaf4
Added a new way to represent the tokens, an abstract syntax tree. First working version.
glm942020-07-01 19:19:32 -05:00
866067802c
Added a readme file to the project.
glm942020-07-01 14:54:18 -05:00
fe30f0c6ba
Fixed a bug in the tolerance calculation.
glm942020-05-02 01:05:46 -05:00
babbdc20af
Wrote some more comments about the code.
glm942020-04-29 22:13:34 -05:00
6ba3414367
Added comments in the code to provide a little bit more insight into what's happening.
glm942020-04-27 11:01:27 -05:00
5a585cf6f8
Improved negative variable handling in the tokenizer. Updated the tolerance checking in the main program.
glm942020-04-26 19:11:01 -05:00
917b58ee87
Fixed a visual bug in the tokenizer's print_token_list function. Updated the user interface in the main program demo.
glm942020-04-26 18:45:36 -05:00
dcf8a50f34
Added support for negative variables in the tokenizer and ptoken object.
glm942020-04-26 18:17:40 -05:00
350021a42b
Added a function to the Tokenizer to return a string of the tokens.
glm942020-04-25 22:31:11 -05:00
00bd817a99
Re-fixed an oversight in the tokenizer dealing with closed parentheses. Minor code clean up on the Calc Engine.
glm942020-04-24 04:00:58 -05:00
6a5de8b3e2
Fixed negative number bug in the tokenizer related to open parenthesises.
glm942020-04-24 02:45:12 -05:00
d93de4d3d6
Fixed a bug in the calc_engine where an expression '(a)^(b), where 'a' and 'b' are any float, would cause a crash and patched the tokenizer to better handle negative numbers.
glm942020-04-24 02:22:05 -05:00
85d61366a7
Updated the calc_engine to use the deque object for its main token listing. Added more robust support for the power operator.
glm942020-04-24 01:38:36 -05:00
c6d063ea35
Commit before attempting to change the backing queue to a deque.
glm942020-04-24 00:20:26 -05:00
4750bed929
Fixed a negative number bug in the tokenizer; started work on a new calc_engine. Mostly working as of this commit.
glm942020-04-23 14:12:17 -05:00
f3ed00e5f2
Added negative number support in the tokenizer.
glm942020-04-22 02:52:52 -05:00
d43f8ef6be
Updated the Variable object to reconize 'k' as an installment variable type. Updated the main program's interactive UI.
glm942020-04-22 02:32:50 -05:00
e360323490
Fixed up the interactive interface to include a cancel option when modifying variable properties.
glm942020-04-20 02:57:54 -05:00
57b2a236a3
Fixed an interface bug in the JSON generator (and the temp interface in the main program) where some variable types would be displayed incorrectly.
glm942020-04-20 02:48:52 -05:00
53f3058194
Merged interactive code to the main program for an upcoming demo, will be reverted back after all that.
glm942020-04-20 02:13:01 -05:00
7507db75b3
Tested the Factor Engine, first round of testing passed. Fixed a bug in the JSON_Generator to stop expression variables from being added in reverse.
glm942020-04-20 00:49:32 -05:00
08bb51d68e
First version with all variables calculated in a token list. 'Factor Engine' starts here.
glm942020-04-20 00:19:49 -05:00
0d7fe94942
Updated the Factor class with a new utility function. Fixed a few small bugs in it as well.
glm942020-04-19 23:49:27 -05:00
ca47912d05
Updated the Expression object to include 'wrong_response' and wrote the code needed to start the finding mutations.
glm942020-04-18 01:13:11 -05:00
58bd836ee2
Changed the token.py to ptoken.py (for Placeholder Token) to avoid naming conflicts with jsonpickle.
glm942020-04-18 00:31:50 -05:00
0a79cdba54
Fixed a grammar check bug in the tokenizer.
glm942020-04-16 14:19:59 -05:00
20e114e33d
Fixed a bug in the tokenizer's 'replace_variables' method that would cause the new token list to hold references to objects in the provided token list.
glm942020-04-14 11:26:38 -05:00
c75905d13c
Updated the tokenizer to include a method to replace variable tokens with the values provided in a list.
glm942020-04-13 09:10:14 -05:00
7605bcdf68
Forgot to prefx 'self.' to all teh list objects in the Factor object.
glm942020-04-13 01:19:40 -05:00
39c94aafa9
Revised the Factor object.
glm942020-04-13 01:17:39 -05:00
d1231b062f
Changed the JSON generator to generate JSON that includes the correct answer for the expression.
glm942020-04-13 00:05:17 -05:00
1265f8ac3e
Created a small utility program to generate JSON files for testing the main input.
glm942020-04-12 00:03:33 -05:00
4386b1af99
Merged the factoring engine into the project. Un-sure if this object approach will work however. Most likely will need to be redesigned in the future.
glm942020-04-10 16:09:42 -05:00
9cf6952eb8
Fixed addition and subraction bug in the calc_engine.
glm942020-04-10 14:34:37 -05:00
ee9ba528c6
Fixed a bug in the tokenizer to make sure it reverses the list before returning. Fixed up the calc engine, however addition/subtraction bugs still exist.
glm942020-04-08 15:05:34 -05:00
c42c8471c0
Finished porting the calc engine from C# to Python.
glm942020-04-08 12:29:26 -05:00
528098d913
Updated exceptions to be more fitting, fixed a parse bug in the tokenizer and added the start of the calc engine.
glm942020-04-08 00:08:20 -05:00
c760dc04b5
Ported Lahiru's tokneizer code over. Appears to work fine. Also did some house keeping.
glm942020-04-07 23:54:55 -05:00