LogicalContracts / LogicalEnglish

Apache License 2.0
25 stars 6 forks source link

[WIP] Feature arithmetic (Just for code comparison, not meant to be merged) #24

Closed MigadaTang closed 1 year ago

jacintodavila commented 1 year ago

Hello. Can you check that other operations beside = still work?. I'm found an error with >=

MigadaTang commented 1 year ago

Hello. Can you check that other operations beside = still work?. I'm found an error with >=

Hi, Jainco. Could you provide a snapshot of the error? Maybe the commit on which you build LE is not up-to-date. I commented out >= in previous commits. But it is working in my latest commit.

Screenshot 2023-05-30 at 16 09 02
MigadaTang commented 1 year ago

Changes in this commit include:

  1. The introduction of arithmetic expressions with four operators +, -, *, /.
  2. A complete removal of the previous expressions DCG, merge the previous date parsing into the new expressions DCG.
  3. A change in the tokenizer package to stop it from recognizing negative numbers, leaving the subtraction symbol '-' to Logical English. In this way, it is much easier to parse dates and unary operators when we can parse the subtraction by ourselves.
  4. A temporary solution to parse 2022-02-06 as dates, not as an expression with two subtractions.