Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions EduNLP/Formula/Formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
13 changes: 12 additions & 1 deletion EduNLP/SIF/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions EduNLP/SIF/segment/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion EduNLP/SIF/tokenization/tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down