Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing/generateText for special characters #353

Closed
jeromesimeon opened this issue May 3, 2019 · 1 comment
Closed

parsing/generateText for special characters #353

jeromesimeon opened this issue May 3, 2019 · 1 comment
Labels

Comments

@jeromesimeon
Copy link
Member

generateText escapes tabs into \t which leads to errors in parsing:

bash-3.2$ cicero parse --sample sample.txt --out data.json
18:05:14 - info: Using current directory as template folder
18:05:15 - info: Creating file: data.json
18:05:15 - info:
{
  "$class": "org.accordproject.promissorynote.PromissoryNoteContract",
  "contractId": "ac42f860-d975-4a47-8e4e-1b6ea818639e",
...
}

If one creates a new sample from that JSON:

bash-3.2$ cicero generateText --data data.json --out sample2.txt
18:05:35 - info: Using current directory as template folder
18:05:36 - info: Creating file: sample2.txt
18:05:36 - info: PROMISSORY NOTE 
1000 USD 01/30/2018

FOR VALUE RECEIVED, the undersigned, "Daniel Selman", an individual residing at "1 Main Street" (“Maker”), hereby promises to pay to the order of "Clause", a CORP, having offices at "246 5th Ave, 3rd Fl, New York, NY 10001", or its successors and permitted assigns\t (“Lender” or the “Company”), the principal sum of 500 USD, plus any and all interest accrued thereon at the Note Rate (defined below), each due and payable in cash in lawful money of the United States on the dates and in the manner set forth in this Promissory Note (this “Note”). 
...

That sample does not parse due to the \t:

bash-3.2$ cicero parse --sample sample2.txt 
18:05:47 - info: Using current directory as template folder
18:05:48 - error: invalid syntax at line 4 col 265:

  FOR VALUE RECEIVED, the undersigned, "Daniel Selman", an individual residing at "1 Main Street" (“Maker”), hereby promises to pay to the order of "Clause", a CORP, having offices at "246 5th Ave, 3rd Fl, New York, NY 10001", or its successors and permitted assigns\t (“Lender” or the “Company”), the principal sum of 500 USD, plus any and all interest accrued thereon at the Note Rate (defined below), each due and payable in cash in lawful money of the United States on the dates and in the manner set forth in this Promissory Note (this “Note”). 
                                                                                                                                                                                                                                                                          ^
Unexpected "\\"

18:05:48 - info: undefined
bash-3.2$ 
@jeromesimeon
Copy link
Member Author

Fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant