File tree Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
2
# 2021/3/8 @ tongshiwei
3
+ #
4
+ from EduNLP .Formula import Formula , FormulaGroup , link_formulas
5
+ #
6
+ # f1 = Formula(r"x + y", variable_standardization=True)
7
+ # f2 = Formula(r"y + x", variable_standardization=True)
8
+ # f3 = Formula(r"z + y", variable_standardization=True)
9
+ #
10
+ # print(f1.element)
11
+ # print(f2.element)
12
+ # print(f3.element)
13
+ #
14
+ # print("-----------------------")
15
+ #
16
+ # link_formulas(f1, f2, f3)
17
+ #
18
+ # print("------------------------")
19
+ #
20
+ # print(f1.element)
21
+ # print(f2.element)
22
+ # print(f3.element)
23
+ #
24
+ # print("---------------------")
25
+ #
26
+ # fg = FormulaGroup(
27
+ # [r"x + y", r"y + x", r"y + z"]
28
+ # )
29
+ # for f in fg:
30
+ # print(f.element)
3
31
4
- import matplotlib .pyplot as plt
5
- from EduNLP .Formula import Formula
6
- from EduNLP .Formula .viz import ForestPlotter
32
+ # fg = FormulaGroup(["x", "y", "x"])
33
+ # print(fg.elements)
7
34
8
- f = Formula (r"\frac{\sqrt{x^2}}{\pi} + 1 = y" , variable_standardization = True )
9
-
10
- ForestPlotter ().export (
11
- f .ast , root_list = [node ["val" ]["id" ] for node in f .element if node ["structure" ]["father" ] is None ],
12
- )
13
- plt .show ()
35
+ fg = FormulaGroup (["x" , Formula ("y" ), "x" ])
36
+ print (fg .elements )
You can’t perform that action at this time.
0 commit comments