Skip to content

Commit

Permalink
Added 'id' to intent rules.
Browse files Browse the repository at this point in the history
Also added `data-fixity`, but this is experimental and likely will change.
  • Loading branch information
NSoiffer committed Jan 22, 2025
1 parent 9597c35 commit 155cbcb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Rules/Intent/calculus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
replace:
- intent:
name: "laplacian"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[2]"]

-
Expand All @@ -20,6 +21,7 @@
replace:
- intent:
name: "laplacian"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: []

-
Expand All @@ -29,6 +31,7 @@
replace:
- intent:
xpath-name: "IfThenElse(*[1]/*[2][.='×'] , 'curl', 'divergence')"
attrs: "id='@id' data-fixity='\"infix\"'"
children: [x: "*[2]"]

-
Expand All @@ -40,6 +43,7 @@
replace:
- intent:
name: "gradient"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[2]"]

-
Expand All @@ -50,6 +54,7 @@
replace:
- intent:
name: "modified-variable"
attrs: "id='@id'"
children:
- x: "*[1]"
- x: "*[2]"
3 changes: 3 additions & 0 deletions Rules/Intent/geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
replace:
- intent:
name: "line-segment"
attrs: "id='@id' data-fixity='\"prefix\"'"
children:
- x: "*[1]/*[1]"
- x: "*[1]/*[3]"
Expand All @@ -30,6 +31,7 @@
replace:
- intent:
name: "ray"
attrs: "id='@id' data-fixity='\"prefix\"'"
children:
- x: "*[1]/*[1]"
- x: "*[1]/*[3]"
Expand All @@ -47,6 +49,7 @@
replace:
- intent:
name: "arc"
attrs: "id='@id' data-fixity='\"prefix\"'"
children:
- x: "*[1]/*[1]"
- x: "*[1]/*[3]"
Expand Down
17 changes: 14 additions & 3 deletions Rules/Intent/linear-algebra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
replace:
- intent:
name: "determinant"
attrs: "id='*[2]/@id' data-fixity='\"table\"'"
children: [x: "*[2]"]

-
Expand All @@ -23,7 +24,7 @@
replace:
- intent:
name: "determinant"
attrs: "id='*[2]/@id'"
attrs: "id='*[2]/@id' data-fixity='\"table\"'"
children: [x: "*[2]/*"]

-
Expand All @@ -35,7 +36,7 @@
replace:
- intent:
name: "matrix"
attrs: "id='*[2]/@id'"
attrs: "id='*[2]/@id' data-fixity='\"table\"'"
children: [x: "*[2]/*"]

-
Expand All @@ -46,6 +47,7 @@
replace:
- intent:
name: "norm"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[2]"]


Expand All @@ -57,6 +59,7 @@
replace:
- intent:
name: "subscripted-norm"
attrs: "id='@id' data-fixity='\"norm;subscript\"'"
children:
- x: "*[1]/*[2]" # grab the contents of the bracketed expr
- x: "*[2]"
Expand All @@ -68,6 +71,7 @@
replace:
- intent:
name: "magnitude"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[2]"]

-
Expand All @@ -78,7 +82,8 @@
replace:
- intent:
name: "transpose"
children: [x: "*[1]"]
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[1]"]

-
name: trace
Expand All @@ -88,6 +93,7 @@
replace:
- intent:
name: "trace"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[3]"]

-
Expand All @@ -98,6 +104,7 @@
replace:
- intent:
name: "dimension"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[3]"]

-
Expand All @@ -108,6 +115,7 @@
replace:
- intent:
name: "homomorphism"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[3]"]

-
Expand All @@ -118,6 +126,7 @@
replace:
- intent:
name: "kernel"
attrs: "id='@id' data-fixity='\"prefix\"'"
children: [x: "*[3]"]

-
Expand All @@ -138,6 +147,7 @@
replace:
- intent:
name: "dot-product"
attrs: "id='@id'"
children: []

-
Expand All @@ -155,4 +165,5 @@
replace:
- intent:
name: "cross-product"
attrs: "id='@id'"
children: []
2 changes: 2 additions & 0 deletions Rules/Intent/probability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
replace:
- intent:
name: "probability"
attrs: "id='@id'"
children: [x: "text()"]

-
Expand All @@ -15,4 +16,5 @@
replace:
- intent:
name: "given"
attrs: "id='@id'"
children: [x: "text()"]

0 comments on commit 155cbcb

Please sign in to comment.