When stepping through my wiktionary parsing code, I often try to look at the Wikicode's nodes element, and almost always IDE shows an error instead of allowing me to view that data.
Example - set breakpoint in the Parser.py 's run() method right after code = mw_parse(...), and examine the code variable. Easiest way to start is run the code with --parse юбка-карандаш parameter (make sure to use python 3.7+).
Error evaluating: thread_id: pid_20335_id_140587393537416
frame_id: 26653320
scope: FRAME
attrs: code _nodes
Traceback (most recent call last):
File "/home/yurik/.IntelliJIdea2019.2/config/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py", line 285, in resolve_compound_variable_fields
return _typeName, resolver.get_dictionary(VariableWithOffset(var, offset) if offset else var)
File "/home/yurik/.IntelliJIdea2019.2/config/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_resolver.py", line 291, in get_dictionary
for item in var[offset:offset+MAX_ITEMS_TO_HANDLE]:
File "/home/yurik/.local/lib/python3.7/site-packages/mwparserfromhell/smart_list.py", line 319, in __iter__
yield self._parent[i]
File "/home/yurik/.local/lib/python3.7/site-packages/mwparserfromhell/smart_list.py", line 96, in __getitem__
return super(SmartList, self).__getitem__(key)
IndexError: list index out of range
When stepping through my wiktionary parsing code, I often try to look at the
Wikicode
'snodes
element, and almost always IDE shows an error instead of allowing me to view that data.Example - set breakpoint in the Parser.py 's run() method right after
code = mw_parse(...)
, and examine thecode
variable. Easiest way to start is run the code with--parse юбка-карандаш
parameter (make sure to use python 3.7+).