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
15 changes: 1 addition & 14 deletions EduNLP/SIF/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,7 @@ def get_token(self):
print("Warning: there is some chinese characters in formula!")
self.warnning = 1
flag = 0
self.head += 1
elif flag and ch_informula == '\n':
# latex 中出现换行符,删除且打印一次 warning
print("Warning: there is a '\\n' in formula!")
self.warnning = 1
flag = 0
self.text = self.text[:self.head] + self.text[self.head + 1:]
self.modify_flag = 1
else:
self.head += 1
self.head += 1
if self.head >= len(self.text):
self.call_error()
return self.error
Expand Down Expand Up @@ -333,10 +324,6 @@ def description_list(self):
>>> text_parser.description_list()
>>> text_parser.fomula_illegal_flag
1
>>> text = '方程$x+y=2\n$'
>>> text_parser = Parser(text)
>>> text_parser.description_list()
Warning: there is a '\n' in formula!
"""
# print('call description_list')
self.description()
Expand Down
4 changes: 0 additions & 4 deletions tests/test_sif/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ def test_parser():
text_parser = Parser(text)
text_parser.description_list()
assert text_parser.fomula_illegal_flag == 1

text = '方程$x+y=2\n$'
text_parser = Parser(text)
text_parser.description_list()