Comments 2
Попытка задать вопрос из нескольких строк вызывает ошибку
Сбой
AssertionError Python 3.7.0: /usr/local/bin/python3
Sun Apr 26 11:19:35 2020
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/srv/cgi/index in ()
21 phil.print_html(hst, qstn) #
22 return
23
24 os.chdir('/srv/cgi/phil')
=> 25 main()
main = /srv/cgi/index in main()
19 #~ pnum = int(form.getfirst('h')) # История (прошлый ответ)
20 hst = eval(form.getfirst('h')) # История (прошлые ответы)
=> 21 phil.print_html(hst, qstn) #
22 return
23
phil = <module 'phil' from '/srv/cgi/phil.py'>, phil.print_html = <function print_html>, hst = [-1, 39], qstn = 'раз\r\nдва\r\n'
/srv/cgi/phil.py in print_html(hst=[-1, 39], qstn='раз\r\nдва\r\n')
41 set.load_mrp('.')
42 try:
=> 43 set.load_txt(qstn)
44 except WordUnknown:
45 msg = m.get_msg()
global set = <module 'set' from '/srv/cgi/set.py'>, set.load_txt = <function load_txt>, qstn = 'раз\r\nдва\r\n'
/srv/cgi/set.py in load_txt(txt='раз\r\nдва\r\n')
64 def load_txt(txt) -> 'список кодированных параграфов':
65 # TODO: обработка исключений
=> 66 mm = morpho.get_morph_tree(txt)
67 if morpho.get_msg():
68 raise WordUnknown
mm undefined, global morpho = <module 'morpho' from '/srv/cgi/morpho.py'>, morpho.get_morph_tree = <function get_morph_tree>, txt = 'раз\r\nдва\r\n'
/srv/cgi/morpho.py in get_morph_tree(src_text='раз\r\nдва\r\n', off=0, answ=False)
334 else:
335 try:
=> 336 forms = corps.struct(word)
337 except WordUnknown:
338 corps.off += sen_off
forms undefined, global corps = <morpho.Corps object>, corps.struct = <bound method Corps.struct of <morpho.Corps object>>, word = 'раз\r'
/srv/cgi/morpho.py in struct(self=<morpho.Corps object>, word='раз\r')
175 if is_num(word): return (word, [(word, 'Ч', '')])
176 if word.startswith('http'): return (word, [(word, '', '')])
=> 177 self.msg = '"{}"\n{}'.format(self.mark_sentence(word), word)
178 raise WordUnknown
179
self = <morpho.Corps object>, self.msg = False, '"{}"\n{}'.format undefined, self.mark_sentence = <bound method Corps.mark_sentence of <morpho.Corps object>>, word = 'раз\r'
/srv/cgi/morpho.py in mark_sentence(self=<morpho.Corps object>, word='раз\r')
142 beg = s.find(word, beg + 1)
143 if beg == -1: print(word, s)
=> 144 assert(beg != -1)
145 end = beg + len(word)
146 if (beg == 0 or self.sentence[beg — 1] in ' «"#№-/(') \
beg = -1
AssertionError:
args = ()
with_traceback = <built-in method with_traceback of AssertionError object>
Sun Apr 26 11:19:35 2020
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/srv/cgi/index in ()
21 phil.print_html(hst, qstn) #
22 return
23
24 os.chdir('/srv/cgi/phil')
=> 25 main()
main = /srv/cgi/index in main()
19 #~ pnum = int(form.getfirst('h')) # История (прошлый ответ)
20 hst = eval(form.getfirst('h')) # История (прошлые ответы)
=> 21 phil.print_html(hst, qstn) #
22 return
23
phil = <module 'phil' from '/srv/cgi/phil.py'>, phil.print_html = <function print_html>, hst = [-1, 39], qstn = 'раз\r\nдва\r\n'
/srv/cgi/phil.py in print_html(hst=[-1, 39], qstn='раз\r\nдва\r\n')
41 set.load_mrp('.')
42 try:
=> 43 set.load_txt(qstn)
44 except WordUnknown:
45 msg = m.get_msg()
global set = <module 'set' from '/srv/cgi/set.py'>, set.load_txt = <function load_txt>, qstn = 'раз\r\nдва\r\n'
/srv/cgi/set.py in load_txt(txt='раз\r\nдва\r\n')
64 def load_txt(txt) -> 'список кодированных параграфов':
65 # TODO: обработка исключений
=> 66 mm = morpho.get_morph_tree(txt)
67 if morpho.get_msg():
68 raise WordUnknown
mm undefined, global morpho = <module 'morpho' from '/srv/cgi/morpho.py'>, morpho.get_morph_tree = <function get_morph_tree>, txt = 'раз\r\nдва\r\n'
/srv/cgi/morpho.py in get_morph_tree(src_text='раз\r\nдва\r\n', off=0, answ=False)
334 else:
335 try:
=> 336 forms = corps.struct(word)
337 except WordUnknown:
338 corps.off += sen_off
forms undefined, global corps = <morpho.Corps object>, corps.struct = <bound method Corps.struct of <morpho.Corps object>>, word = 'раз\r'
/srv/cgi/morpho.py in struct(self=<morpho.Corps object>, word='раз\r')
175 if is_num(word): return (word, [(word, 'Ч', '')])
176 if word.startswith('http'): return (word, [(word, '', '')])
=> 177 self.msg = '"{}"\n{}'.format(self.mark_sentence(word), word)
178 raise WordUnknown
179
self = <morpho.Corps object>, self.msg = False, '"{}"\n{}'.format undefined, self.mark_sentence = <bound method Corps.mark_sentence of <morpho.Corps object>>, word = 'раз\r'
/srv/cgi/morpho.py in mark_sentence(self=<morpho.Corps object>, word='раз\r')
142 beg = s.find(word, beg + 1)
143 if beg == -1: print(word, s)
=> 144 assert(beg != -1)
145 end = beg + len(word)
146 if (beg == 0 or self.sentence[beg — 1] in ' «"#№-/(') \
beg = -1
AssertionError:
args = ()
with_traceback = <built-in method with_traceback of AssertionError object>
Sign up to leave a comment.
Филина грамота