Skip to content

Commit

Permalink
Spelling (#299)
Browse files Browse the repository at this point in the history
* Fix table from http://docs.jsonata.org/boolean-functions.html

Signed-off-by: Josh Soref <[email protected]>

* spelling: a

Signed-off-by: Josh Soref <[email protected]>

* spelling: background

Signed-off-by: Josh Soref <[email protected]>

* spelling: cannot

Signed-off-by: Josh Soref <[email protected]>

* spelling: equivalence

Signed-off-by: Josh Soref <[email protected]>

* spelling: evaluated

Signed-off-by: Josh Soref <[email protected]>

* spelling: expression

Signed-off-by: Josh Soref <[email protected]>

* spelling: function

Signed-off-by: Josh Soref <[email protected]>

* spelling: hundredth

Signed-off-by: Josh Soref <[email protected]>

* spelling: ill defined

Signed-off-by: Josh Soref <[email protected]>

* spelling: inconsistent

Signed-off-by: Josh Soref <[email protected]>

* spelling: intface

Signed-off-by: Josh Soref <[email protected]>

* spelling: irrelevant

Signed-off-by: Josh Soref <[email protected]>

* spelling: javascript

Signed-off-by: Josh Soref <[email protected]>

* spelling: jsonata

Signed-off-by: Josh Soref <[email protected]>

* spelling: neither/nor

Signed-off-by: Josh Soref <[email protected]>

* spelling: nonexistent

Signed-off-by: Josh Soref <[email protected]>

* spelling: omitted

Signed-off-by: Josh Soref <[email protected]>

* spelling: parentheses

Signed-off-by: Josh Soref <[email protected]>

* spelling: performance

Signed-off-by: Josh Soref <[email protected]>

* spelling: preferences

Signed-off-by: Josh Soref <[email protected]>

* spelling: preserve

Signed-off-by: Josh Soref <[email protected]>

* spelling: right

Signed-off-by: Josh Soref <[email protected]>

* spelling: semantics

Signed-off-by: Josh Soref <[email protected]>

* spelling: separator

Signed-off-by: Josh Soref <[email protected]>

* spelling: temperature

Signed-off-by: Josh Soref <[email protected]>

* spelling: token

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Feb 1, 2024
1 parent a5b5bb4 commit e0014ef
Show file tree
Hide file tree
Showing 47 changed files with 361 additions and 214 deletions.
11 changes: 10 additions & 1 deletion .README.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,15 @@ <h3> <a id="current-limitations" class="anchor" href="#current-limitations" aria
<li>$parseInteger()</li>
</ul>
<p>We did not implement any of <a href="https://docs.jsonata.org/embedding-extending" rel="nofollow">https://docs.jsonata.org/embedding-extending</a></p>
<p>From: <a href="https://docs.jsonata.org/date-time" rel="nofollow">https://docs.jsonata.org/date-time</a> $fromMillis() only accepts a number, not the format picture, nor timezone $now() does not accept the picture string (e.g., $now(&quot;[Y0000]&quot;) reports an arg1 error</p>
<p>From: <a href="https://docs.jsonata.org/date-time" rel="nofollow">https://docs.jsonata.org/date-time</a>:
<ul>
<li>
$fromMillis() only accepts a number. Neither the format picture nor timezone arguments are accepted.
</li>
<li>
$now() does not accept a picture string argument (i.e., $now(&quot;[Y0000]&quot;) reports an arg1 error).
</li>
</ul>
</p>
</body>
</html>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ git clone https://github.com/IBM/JSONata4Java.git
The Java version uses ANTLR to build the parser for the language, and Java Objects are more tightly controlled that JavaScript Objects. Therefore, some things differ between the Java implementation and JavaScript implementation. For example:
- we require functions to be called with their arguments, even if no arguments are being passed. This is because we differentiate a variable reference with no parentheses from a function that has parentheses.
- we require variables to begin with a letter or an underscore (but not a number) whereas jsonata.org allows variables to begin with numbers ([Issue 267](https://github.com/IBM/JSONata4Java/issues/267)).
- Arrays hold JsonNode types so can not hold references to functions, whereas jsonata.org can manage function references within an array ([Issue 268](https://github.com/IBM/JSONata4Java/issues/268)).
- Arrays hold JsonNode types so cannot hold references to functions, whereas jsonata.org can manage function references within an array ([Issue 268](https://github.com/IBM/JSONata4Java/issues/268)).

### Java 11 and 1.8 Versions needed for new Antlr 4.13.1 (Also updated project file to Eclipse 2023-12)

Expand Down Expand Up @@ -83,7 +83,7 @@ Many thanks to **Martin Bluemel** for adding these new features&colon;

**Improved Chaining**&colon;
JSONata4Java basically does support function chaining now. However, it does not yet
support the "function name only" syntax for function chaining (the one without paratheses).
support the "function name only" syntax for function chaining (the one without parentheses).
So we recommend using a syntax like below&colon;

```
Expand Down
2 changes: 1 addition & 1 deletion docs/com/api/jsonata4java/JSONataUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ <h4>openTextFile</h4>
<dd>open buffered reader to allow individual lines of a text file to be
read</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - if the file can not be found</dd>
<dd><code>java.lang.Exception</code> - if the file cannot be found</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/api/jsonata4java/JSONataUtils.html#closeTextFile-java.io.BufferedReader-"><code>to close the reader returned by this
function</code></a></dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,27 @@ <h2 title="Class BooleanFunction" class="title">Class BooleanFunction</h2>
extends <a href="../../../../../com/api/jsonata4java/expressions/functions/FunctionBase.html" title="class in com.api.jsonata4java.expressions.functions">FunctionBase</a>
implements <a href="../../../../../com/api/jsonata4java/expressions/functions/Function.html" title="interface in com.api.jsonata4java.expressions.functions">Function</a></pre>
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,27 @@ <h3>Uses of <a href="../../../../../../com/api/jsonata4java/expressions/function
<td class="colFirst"><code>class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/api/jsonata4java/expressions/functions/BooleanFunction.html" title="class in com.api.jsonata4java.expressions.functions">BooleanFunction</a></span></code>
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr class="altColor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,27 @@ <h3>Uses of <a href="../../../../../../com/api/jsonata4java/expressions/function
<td class="colFirst"><code>class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/api/jsonata4java/expressions/functions/BooleanFunction.html" title="class in com.api.jsonata4java.expressions.functions">BooleanFunction</a></span></code>
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr class="altColor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,27 @@ <h1 title="Package" class="title">Package&nbsp;com.api.jsonata4java.expressions.
<td class="colFirst"><a href="../../../../../com/api/jsonata4java/expressions/functions/BooleanFunction.html" title="class in com.api.jsonata4java.expressions.functions">BooleanFunction</a></td>
<td class="colLast">
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr class="altColor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ <h4>compare</h4>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true is left is greater than right</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../com/api/jsonata4java/expressions/EvaluateRuntimeException.html" title="class in com.api.jsonata4java.expressions">EvaluateRuntimeException</a></code> - if left and right can not be converted to
<dd><code><a href="../../../../../com/api/jsonata4java/expressions/EvaluateRuntimeException.html" title="class in com.api.jsonata4java.expressions">EvaluateRuntimeException</a></code> - if left and right cannot be converted to
numbers</dd>
</dl>
</li>
Expand Down
38 changes: 27 additions & 11 deletions docs/com/api/jsonata4java/expressions/utils/BooleanUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ <h3>Method Summary</h3>
<div class="block">See http://docs.jsonata.org/boolean-functions.html#booleanarg

The convertJsonNodeToBoolean method converts the node passed in to a boolean
based on the casting semnatics defined by JSONata.</div>
based on the casting semantics defined by JSONata.</div>
</td>
</tr>
</table>
Expand Down Expand Up @@ -201,16 +201,32 @@ <h3>Method Detail</h3>
<li class="blockList">
<h4>convertJsonNodeToBoolean</h4>
<pre>public static&nbsp;boolean&nbsp;convertJsonNodeToBoolean(com.fasterxml.jackson.databind.JsonNode&nbsp;node)</pre>
<div class="block">See http://docs.jsonata.org/boolean-functions.html#booleanarg

The convertJsonNodeToBoolean method converts the node passed in to a boolean
based on the casting semnatics defined by JSONata.

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<div class="block">From http://docs.jsonata.org/boolean-functions.html
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>

The convertJsonNodeToBoolean method converts the node passed in to a boolean
based on the casting semantics defined by JSONata.

<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>node</code> - The node to convert to a boolean</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ <h4>testConditionalLazyEval</h4>
expressions.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../com/api/jsonata4java/expressions/ParseException.html" title="class in com.api.jsonata4java.expressions">ParseException</a></code> - if the expression can not parse correctly</dd>
<dd><code><a href="../../../../../com/api/jsonata4java/expressions/ParseException.html" title="class in com.api.jsonata4java.expressions">ParseException</a></code> - if the expression cannot parse correctly</dd>
<dd><code><a href="../../../../../com/api/jsonata4java/expressions/EvaluateException.html" title="class in com.api.jsonata4java.expressions">EvaluateException</a></code> - if the expression fail its evaluation</dd>
</dl>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,28 @@ <h2 title="Class BooleanFunctionTests" class="title">Class BooleanFunctionTests<
<pre>public class <span class="typeNameLabel">BooleanFunctionTests</span>
extends java.lang.Object</pre>
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
</li>
</ul>
</div>
<div class="summary">
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
Expand Down
31 changes: 21 additions & 10 deletions docs/com/api/jsonata4java/test/expressions/package-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,27 @@ <h1 title="Package" class="title">Package&nbsp;com.api.jsonata4java.test.express
<td class="colFirst"><a href="../../../../../com/api/jsonata4java/test/expressions/BooleanFunctionTests.html" title="class in com.api.jsonata4java.test.expressions">BooleanFunctionTests</a></td>
<td class="colLast">
<div class="block">From http://docs.jsonata.org/boolean-functions.html

$boolean(arg)

Casts the argument to a Boolean using the following rules:

Boolean: unchanged string: empty false string: non-empty true number: 0 false
number: non-zero true null: false array: empty false array: contains a member
that casts to true true array: all members cast to false false object: empty
false object: non-empty true function: (functions are not currently
supported) false</div>
<p>
$boolean(arg)
</p>
<table><caption>Casts the argument to a Boolean using the following rules</caption><thead>
<tr><th>Argument type</th><th>Result</th></tr>
</thead><tbody>
<tr><td>Boolean</td><td>unchanged</td></tr>
<tr><td>string: empty</td><td>false</td></tr>
<tr><td>string: non-empty</td><td>true</td></tr>
<tr><td>number: 0</td><td>false</td></tr>
<tr><td>number: non-zero</td><td>true</td></tr>
<tr><td>null</td><td>false</td></tr>
<tr><td>array: empty</td><td>false</td></tr>
<tr><td>array: contains a member that casts to true</td><td>true</td></tr>
<tr><td>array: all members cast to false</td><td>false</td></tr>
<tr><td>object: empty</td><td>false</td></tr>
<tr><td>object: non-empty</td><td>true</td></tr>
<tr><td>function: (functions are not currently supported)</td><td>false</td></tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr class="rowColor">
Expand Down
4 changes: 2 additions & 2 deletions docs/com/api/jsonata4java/text/expressions/utils/Utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ <h4>test</h4>
<dd><code>expression</code> - expression to be tested</dd>
<dd><code>expected</code> - result expected</dd>
<dd><code>expectedExceptionMsg</code> - the text of an expected exception</dd>
<dd><code>rootContext</code> - the json object against which the expression is evalated</dd>
<dd><code>rootContext</code> - the json object against which the expression is evaluated</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - if expected values are not provided</dd>
</dl>
Expand All @@ -475,7 +475,7 @@ <h4>test</h4>
<dd><code>expression</code> - expression to be tested</dd>
<dd><code>expected</code> - result expected</dd>
<dd><code>expectedEvaluateExceptionMsg</code> - the text of an expected exception</dd>
<dd><code>rootContext</code> - the json object against which the expression is evalated</dd>
<dd><code>rootContext</code> - the json object against which the expression is evaluated</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - if expected values are not provided</dd>
</dl>
Expand Down
Loading

0 comments on commit e0014ef

Please sign in to comment.