Skip to content

Conversation

@alvadia
Copy link

@alvadia alvadia commented Mar 4, 2021

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 <version_from_xml> \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.

First argument: from (example - dict.xml)
Second argument: to (example - dict.json)
Third argument: mode (example - json).
@alvadia
Copy link
Author

alvadia commented Mar 4, 2021

#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant