umath 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +35 -13
- data/artifacts/umath.bindings.ruby.json +1 -1
- data/artifacts/umath.json +1 -1
- data/data/umath-symbols.json +1 -1
- data/docs/model-contract.adoc +1 -8
- data/docs/parser-contract.adoc +3 -3
- data/docs/testsuite-pin.adoc +66 -16
- data/docs/unicodemath.adoc +729 -0
- data/lib/umath/engine.rb +18 -7
- data/lib/umath/schema.rb +33 -0
- data/lib/umath/version.rb +1 -1
- data/schema/manifest.json +14 -0
- data/schema/umath.bundle.json +11270 -0
- metadata +12 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80682dbaf5fc218e1b77590fe3b595e4ad8f47d99ed9406b0bf5246c30eff3d4
|
|
4
|
+
data.tar.gz: 275a6ecc118656a6d591108f449177a4fcd9924ee8197ea71254b7c7d4801d44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4dc7e99b95a51c55fb34c484a890657783754a1912033e0a07f8433139bef2e4281d8c20590498d65c625a5307e94ce61976c47322c97d9506ce310689bf78d9
|
|
7
|
+
data.tar.gz: 9f31e298dbc3918bb53fa20cdaa305beee0029c3bc8993102663dab463828a529da35a45bdc36e695c6b2455c7313e88f63c4ead991810fbc7a3a80cb0a8f1bf
|
data/README.adoc
CHANGED
|
@@ -24,7 +24,7 @@ Add it to your `Gemfile`:
|
|
|
24
24
|
|
|
25
25
|
[source,ruby]
|
|
26
26
|
----
|
|
27
|
-
gem "umath", "~> 0.
|
|
27
|
+
gem "umath", "~> 0.2.0"
|
|
28
28
|
----
|
|
29
29
|
|
|
30
30
|
Umath needs Ruby 3.2 or later. Its runtime dependencies are
|
|
@@ -79,10 +79,17 @@ Umath.parse("1,5", decimal: ",")
|
|
|
79
79
|
Umath.parse("1٫5", decimal: "٫")
|
|
80
80
|
----
|
|
81
81
|
|
|
82
|
+
The `decimal` field of the document keeps the marker you passed. Inside the
|
|
83
|
+
number, a non-ASCII marker such as `٫` is spelled as an HTML entity
|
|
84
|
+
(`٫`), as for any other non-ASCII character.
|
|
85
|
+
|
|
82
86
|
The rules for each model class are in link:docs/model-contract.adoc[the
|
|
83
87
|
model contract], and the accepted syntax and the preprocessing of the input
|
|
84
88
|
in link:docs/parser-contract.adoc[the parser contract].
|
|
85
89
|
|
|
90
|
+
For a description of the UnicodeMath notation the gem reads and the model each
|
|
91
|
+
construct becomes, see link:docs/unicodemath.adoc[UnicodeMath notation].
|
|
92
|
+
|
|
86
93
|
== Errors
|
|
87
94
|
|
|
88
95
|
Input that is not valid UnicodeMath raises `Umath::ParseError`, which
|
|
@@ -117,16 +124,10 @@ Asking for `engine: :native` where it cannot run raises
|
|
|
117
124
|
the current thread.
|
|
118
125
|
|
|
119
126
|
Ruby is the default because it is the engine that matches legacy Plurimath.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
in
|
|
125
|
-
link:spec/parser/fixtures/oracle/native-divergences.yml[`spec/parser/fixtures/oracle/native-divergences.yml`],
|
|
126
|
-
and CI checks that they still differ, so the list shrinks when the native
|
|
127
|
-
engine changes. The native engine is faster, and the Ruby engine is slower,
|
|
128
|
-
especially on input it refuses. Choose `engine: :native` when speed matters
|
|
129
|
-
more to you than the legacy tree for those inputs.
|
|
127
|
+
Up to Parsanol 1.3.133 the native engine returned a different tree on 18
|
|
128
|
+
inputs from the testsuite's `fixtures/unicode-expectations.yaml`; from 1.3.134
|
|
129
|
+
it returns the legacy tree for those inputs too. The native engine is faster, and the Ruby engine is slower,
|
|
130
|
+
especially on input it refuses. Choose `engine: :native` when speed matters.
|
|
130
131
|
|
|
131
132
|
== Testing against the Plurimath testsuite
|
|
132
133
|
|
|
@@ -134,8 +135,9 @@ The UnicodeMath cases of
|
|
|
134
135
|
https://github.com/plurimath/plurimath-testsuite[plurimath-testsuite] are
|
|
135
136
|
kept there as numbered, immutable generations.
|
|
136
137
|
`spec/fixtures/testsuite-pin.yml` names the exact commit, generation and
|
|
137
|
-
digest this gem is tested against, and CI replays every raw-tree
|
|
138
|
-
generation on both engines
|
|
138
|
+
digest this gem is tested against, and CI replays every raw-tree and
|
|
139
|
+
typed-model row of that generation on both engines, including the rows for
|
|
140
|
+
the 675 external UnicodeMath inputs of the testsuite's fixtures. CI also compares the parse tree with the one the
|
|
139
141
|
pinned Plurimath commit produces for every UnicodeMath case of the testsuite.
|
|
140
142
|
See link:docs/testsuite-pin.adoc[the testsuite pin].
|
|
141
143
|
|
|
@@ -153,3 +155,23 @@ output formats.
|
|
|
153
155
|
|
|
154
156
|
Copyright Ribose Inc. Licensed under the BSD 2-Clause License; see
|
|
155
157
|
link:LICENSE.md[].
|
|
158
|
+
|
|
159
|
+
== Portable model declarations
|
|
160
|
+
|
|
161
|
+
`require "umath/schema"` exposes `Umath::Schema.bundle_json`, `bundle` and
|
|
162
|
+
`bundle_path`. Each access verifies the packaged declaration checksum. The
|
|
163
|
+
bundle contains all 75 reachable models and explicit identity JSON field
|
|
164
|
+
mappings for the portable data projection; it does not replace Ruby model
|
|
165
|
+
runtime behavior or claim wire-byte identity for every serialization mode.
|
|
166
|
+
|
|
167
|
+
Regenerate from this checkout with the LML declaration exporter available:
|
|
168
|
+
|
|
169
|
+
[source,sh]
|
|
170
|
+
----
|
|
171
|
+
ruby -I/path/to/lutaml-model/lib -Ilib scripts/export_model_declarations.rb
|
|
172
|
+
----
|
|
173
|
+
|
|
174
|
+
The exporter preserves existing explicit JSON mappings and makes otherwise
|
|
175
|
+
implicit field names explicit for declaration export only. `schema/manifest.json`
|
|
176
|
+
records definition-file and producer-script hashes, the actual exporter Git
|
|
177
|
+
revision, and the bundle hash. The artifact matches the shared TS/Rust input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"artifact_kind":"parg-bindings","target":"ruby","binding_version":1,"grammar":"Umath","grammar_version":"0.1.0","grammar_source_hash":"
|
|
1
|
+
{"artifact_kind":"parg-bindings","target":"ruby","binding_version":1,"grammar":"Umath","grammar_version":"0.1.0","grammar_source_hash":"8fbf980d93a4e7a47638c795ae86c519626956b6a68a65d1e36b610587602fcc","shape":"parsanol-tree/v2","entries":{"comma":{"bindings":[{"capture":"umath_tree","path":"umath_tree","type":"raw","card":null,"preprocess":null},{"capture":"umath_tree","path":"model","type":"any","card":null,"preprocess":null}]},"dot":{"bindings":[{"capture":"umath_tree","path":"umath_tree","type":"raw","card":null,"preprocess":null},{"capture":"umath_tree","path":"model","type":"any","card":null,"preprocess":null}]},"arabic":{"bindings":[{"capture":"umath_tree","path":"umath_tree","type":"raw","card":null,"preprocess":null},{"capture":"umath_tree","path":"model","type":"any","card":null,"preprocess":null}]}},"checksum":"sha256:3410be351c44092001c7154e2083f03c5bed917d5ceca5b9ced07cc3c542c7f9"}
|