diff --git a/EduNLP/Formula/Formula.py b/EduNLP/Formula/Formula.py index 77e5f7d0..6eb80049 100644 --- a/EduNLP/Formula/Formula.py +++ b/EduNLP/Formula/Formula.py @@ -17,18 +17,6 @@ class Formula(object): """ The part transform a formula to the parsed abstracted syntax tree. - Attributes - ------------ - ast - show all ast details - elements - just show elements' id, type, text and role - ast_graph - draw a ast graph - to_str - resetable - return bool - Parameters ---------- formula: str or List[Dict] @@ -54,6 +42,17 @@ class Formula(object): >>> f.elements [{'id': 0, 'type': 'mathord', 'text': 'x', 'role': None, 'var': 0}] + Attributes + ------------ + ast + show all ast details + elements + just show elements' id, type, text and role + ast_graph + draw a ast graph + to_str + resetable + return bool """ def __init__(self, formula: (str, List[Dict]), variable_standardization=False, const_mathord=None, init=True, *args, **kwargs): diff --git a/EduNLP/SIF/segment/segment.py b/EduNLP/SIF/segment/segment.py index 7e9ed5ed..39e2f869 100644 --- a/EduNLP/SIF/segment/segment.py +++ b/EduNLP/SIF/segment/segment.py @@ -82,6 +82,22 @@ class SepSegment(str): class SegmentList(object): """ + Parameters + ---------- + item + figures:dict + + Returns + ---------- + list + tokenizated item + + Examples + -------- + >>> test_item = "如图所示,则三角形$ABC$的面积是$\\SIFBlank$。$\\FigureID{1}$" + >>> SegmentList(test_item) + ['如图所示,则三角形', 'ABC', '的面积是', '\\\\SIFBlank', '。', \\FigureID{1}] + Attributes ---------- segments @@ -98,22 +114,6 @@ class SegmentList(object): show tag segments describe show number of each elements - - Parameters - ---------- - item - figures:dict - - Returns - ---------- - list - tokenizated item - - Examples - -------- - >>> test_item = "如图所示,则三角形$ABC$的面积是$\\SIFBlank$。$\\FigureID{1}$" - >>> SegmentList(test_item) - ['如图所示,则三角形', 'ABC', '的面积是', '\\\\SIFBlank', '。', \\FigureID{1}] """ def __init__(self, item, figures: dict = None): self._segments = []