Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * This script removes the English readings from the JMDict dictionary file used
- * by Yomichan. Using this lets you get the JMDict frequency information without
- * the English dictionary definitions.
- *
- * Pass the filename in as a command line argument.
- *
- * Usage:
- *
- * 1. Download the JMDict zip file from the Yomichan website
- * 2. Unzip it
- * 3. Run all the term_bank files through this script and replace the output
- * with the original file
- * 4. Zip everything back up
- * 5. Load the new zip file into Yomichan
- *
- **/
- const fs = require('fs');
- // get filename from command line arg
- const filename = process.argv[2];
- // read file
- const json = JSON.parse(fs.readFileSync(filename, 'utf8'));
- // get rid of english definitions
- json.forEach(e => e[5] = []);
- // print back out
- console.log(JSON.stringify(json));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement