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

Should template processing perform variable/properties unification #21

Closed
jeromesimeon opened this issue Dec 27, 2017 · 1 comment
Closed

Comments

@jeromesimeon
Copy link
Member

jeromesimeon commented Dec 27, 2017

Taking an example from the latedeliveryandpenalty template, one of the sentences uses the same variable/property twice:

Any fractional part of a [{fractionalPart}] is to be considered a full
[{fractionalPart}].

The current implementation allows for distinct values of that same property, but disregards the second value. Here is a parsing run that illustrates this:

bash-3.2$ cat latedeliveryandpenalty/sample.txt  
Late Delivery and Penalty. In case of delayed delivery except for Force Majeure cases, the Seller shall pay to the Buyer for every 2 DAY of delay penalty amounting to 10.5% of the total value of the Equipment whose delivery has been delayed. Any fractional part of a DAY is to be considered a full WEEK. The total amount of penalty shall not however, exceed 55% of the total value of the Equipment involved in late delivery. If the delay is more than 15 DAY, the Buyer is entitled to terminate this Contract.
bash-3.2$ 
bash-3.2$ cicero parse --template ./latedeliveryandpenalty/ --dsl ./latedeliveryandpenalty/sample.txt  
14:58:56 - info: Logging initialized. 2017-12-23T19:58:56.569Z
14:58:56 - info: Logging initialized. 2017-12-23T19:58:56.741Z
14:58:57 - info: {"$class":"org.accordproject.latedeliveryandpenalty.TemplateModel","forceMajeure":true,"penaltyDuration":{"$class":"org.accordproject.base.Duration","amount":2,"unit":"DAY"},"penaltyPercentage":10.5,"capPercentage":55,"termination":{"$class":"org.accordproject.base.Duration","amount":15,"unit":"DAY"},"fractionalPart":"DAY"}

Note that the corresponding sentence is Any fractional part of a DAY is to be considered a full WEEK. which seems inconsistent, and the second occurrence (WEEK) of the fractional part is ignored.

Should the template parser unify on those fields used more than once, in which case the above sentence will be rejected?

@jeromesimeon
Copy link
Member Author

Duplicate of #4

@jeromesimeon jeromesimeon marked this as a duplicate of #4 Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant