diff --git a/c-example/Rules/Intent/general.yaml b/c-example/Rules/Intent/general.yaml index 41e6683..4d91f14 100644 --- a/c-example/Rules/Intent/general.yaml +++ b/c-example/Rules/Intent/general.yaml @@ -550,7 +550,9 @@ - name: set tag: mrow - match: "IsBracketed(., '{', '}')" + # sets have { }s and should have at least one of ",∈∉|" (vertical bar is "such that") or be the empty set + match: "IsBracketed(., '{', '}') and + (count(*)=2 or (count(*)=3 and IsNode(*[2], 'leaf')) or . != translate(., ',∈∉|:', ''))" replace: - intent: name: "set" @@ -623,21 +625,16 @@ name: mtable-property-is-set tag: mtable variables: [MTableProperty: "IfThenElse(contains(@data-intent-property, ':grid:'), - IfThenElse(parent::m:mrow[IsBracketed(., '|', '|')], 'determinant', 'matrix'), + IfThenElse(parent::m:mrow[IsBracketed(., '|', '|')], 'determinant', 'matrix'), IfThenElse(contains(@data-intent-property, ':piecewise:'), 'piecewise', IfThenElse(contains(@data-intent-property, ':system-of-equation:'), 'system-of-equation', IfThenElse(contains(@data-intent-property, ':lines:'), 'lines',''))))"] match: "$MTableProperty !=''" replace: - - with: - variables: - - TableProperty: "$MTableProperty" - - IsColumnSilent: "not(contains(@data-intent-property, ':grid:'))" - replace: - - intent: - xpath-name: "$MTableProperty" - children: - - x: "*" + - intent: + xpath-name: "$MTableProperty" + children: + - x: "*" - name: mtable-matrix-property @@ -648,7 +645,6 @@ - with: variables: - TableProperty: "'matrix'" - - IsColumnSilent: "false()" replace: - intent: name: "matrix" @@ -663,7 +659,6 @@ - with: variables: - TableProperty: "'determinant'" - - IsColumnSilent: "false()" replace: - intent: name: "determinant" @@ -679,7 +674,6 @@ - with: variables: - TableProperty: "'piecewise'" - - IsColumnSilent: "true()" replace: - intent: name: "piecewise" @@ -694,7 +688,6 @@ - with: variables: - TableProperty: "'system-of-equations'" - - IsColumnSilent: "true()" replace: - intent: name: "system-of-equations" @@ -709,7 +702,6 @@ - with: variables: - TableProperty: "'lines'" - - IsColumnSilent: "true()" replace: - intent: name: "lines" diff --git a/c-example/Rules/intent.yaml b/c-example/Rules/intent.yaml index 35db8c2..c249bec 100644 --- a/c-example/Rules/intent.yaml +++ b/c-example/Rules/intent.yaml @@ -26,11 +26,9 @@ xpath-name: "name(.)" children: [] -- - include: "Intent/geometry.yaml" - -- - include: "Intent/linear-algebra.yaml" +- include: "Intent/geometry.yaml" +- include: "Intent/linear-algebra.yaml" +- include: "Intent/calculus.yaml" - # this is last because other rules are/should be(???) more specific