Open alvadia opened 3 years ago
Added python script for parsing xml -> tsv or json. First argument: from (example - dict.xml) Second argument: to (example - dict.json) Third argument: mode (example - json).
Sample format of tsv (' ' means space): id \t root \t data \t extra \n
OpenCorpora \t dictionary \t \t \n
[ \t ' ' <';'.join(attributes)> \t ' ' <';'.join(attributes)> [, ' ' <';'.join(attributes)>] \t \n]
[ \t \t \t \n]*
It requires much less space. This script is a sample, it requires a .sh wrapper.
Added python script for parsing xml -> tsv or json. First argument: from (example - dict.xml) Second argument: to (example - dict.json) Third argument: mode (example - json).
Sample format of tsv (' ' means space): id \t root \t data \t extra \n
header \t dictionary \t version \t revision \n
OpenCorpora \t dictionary \t \t \n
lemmas lemma variants empty
[ \t ' ' <';'.join(attributes)> \t ' ' <';'.join(attributes)> [, ' ' <';'.join(attributes)>] \t \n]
gramemes \t parent \t alias \t description \n
[ \t \t \t \n]*
links \t from \t to \t type \n
[ \t \t \t \n]*
It requires much less space. This script is a sample, it requires a .sh wrapper.