https://github.com/jeka-kiselyov/mdict
node.js mdict (*.mdx, *.mdd) file reader
https://github.com/jeka-kiselyov/mdict
binary dictionaries dictionary languages mdx node node-module nodejs
Last synced: 22 days ago
JSON representation
node.js mdict (*.mdx, *.mdd) file reader
- Host: GitHub
- URL: https://github.com/jeka-kiselyov/mdict
- Owner: jeka-kiselyov
- License: mit
- Created: 2017-02-26T14:31:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T16:09:01.000Z (over 4 years ago)
- Last Synced: 2025-04-05T11:04:51.392Z (about 2 months ago)
- Topics: binary, dictionaries, dictionary, languages, mdx, node, node-module, nodejs
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 56
- Watchers: 5
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node mdict
> This project is out of date and there're no plans to update it. Please use [terasum/js-mdict](https://github.com/terasum/js-mdict) for your projects.
node.js mdict (*.mdx, *.mdd) file reader
Rude refactoring of https://github.com/fengdh/mdict-js to make it work on nodejs by [Jeka Kiselyov](https://github.com/jeka-kiselyov).
Done enough to make it work for my project(with predefined dictionaries). It's tested with few .mdx files only, so there may be some bugs with other dictionaries. Please check and please feel free to submit pull requests with optimizations, unit tests etc.Released under terms of the MIT License, as original library.
Installation:
```bash
npm install mdict
```Usage:
```javascript
var mdict = require('mdict');mdict.dictionary('dictionary.mdx').then(function(dictionary){
//// dictionary is loaded
dictionary.search({
phrase: 'دهخدا*', /// '*' and '?' supported
max: 10 /// maximum results
}).then(function(foundWords){
console.log('Found words:');
console.log(foundWords); /// foundWords is arrayvar word = ''+foundWords[0];
console.log('Loading definitions for: '+word);
return dictionary.lookup(word); /// typeof word === string
}).then(function(definitions){
console.log('definitions:'); /// definition is array
console.log(definitions);
});});
```This is [on GitHub](https://github.com/jeka-kiselyov/mdict).