diff --git a/EduNLP/Formula/Formula.py b/EduNLP/Formula/Formula.py index 71038480..77e5f7d0 100644 --- a/EduNLP/Formula/Formula.py +++ b/EduNLP/Formula/Formula.py @@ -17,6 +17,18 @@ 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] @@ -129,6 +141,16 @@ class FormulaGroup(object): """ The part transform a group of formula to the parsed abstracted syntax forest. + Attributes + ------------ + to_str + ast + show all ast details + elements + just show elements' id, type, text and role + ast_graph + draw a ast graph + Parameters ---------- formula: str or List[Dict] or List[Formula] diff --git a/EduNLP/SIF/parser/parser.py b/EduNLP/SIF/parser/parser.py index cd2bf65e..471bb450 100644 --- a/EduNLP/SIF/parser/parser.py +++ b/EduNLP/SIF/parser/parser.py @@ -3,7 +3,18 @@ class Parser: - """initial data and special variable""" + """ + initial data and special variable + + Attributes + ---------- + get_token + Get different elements in the item. + txt_list + show txt list + description_list + use Parser to process and describe the txt + """ def __init__(self, data): self.lookahead = 0 self.head = 0 diff --git a/EduNLP/SIF/segment/segment.py b/EduNLP/SIF/segment/segment.py index 2bbefdca..7e9ed5ed 100644 --- a/EduNLP/SIF/segment/segment.py +++ b/EduNLP/SIF/segment/segment.py @@ -82,6 +82,23 @@ class SepSegment(str): class SegmentList(object): """ + Attributes + ---------- + segments + show all segments + text_segments + show text segments + formula_segments + show formula segments + figure_segments + show figure sements + ques_mark_segments + show question mark segments + tag_segments + show tag segments + describe + show number of each elements + Parameters ---------- item diff --git a/EduNLP/SIF/tokenization/tokenization.py b/EduNLP/SIF/tokenization/tokenization.py index 53f6fe75..93eb61a1 100644 --- a/EduNLP/SIF/tokenization/tokenization.py +++ b/EduNLP/SIF/tokenization/tokenization.py @@ -26,7 +26,20 @@ class TokenList(object): Attributes ------------- - + tokens + show all tokens + text_tokens + show text tokens + formula_tokens + show formula tokens + figure_tokens + show figure tokens + ques_mark_tokens + show question mark tokens + tag_tokens + show tag tokens + describe + show number of each elements """ def __init__(self, segment_list: SegmentList, text_params=None, formula_params=None, figure_params=None): self._tokens = []