-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c1db02
commit 2e0661d
Showing
20 changed files
with
228 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# MDX-DICT-PARSER | ||
|
||
This is a package based on [napi-rs](https://napi.rs/) and [mdict-parser](https://crates.io/crates/mdict-parser), which provides the node-binding to read all the words and their definitions from mdict(.mdx) file. | ||
|
||
## Usage | ||
|
||
This package is ESM only. | ||
|
||
First, install the package | ||
|
||
```bash | ||
npm i mdx-dict-parser | ||
``` | ||
|
||
You can write such code in typescript. | ||
|
||
```ts | ||
import { parseMdict, DictRecord } from "mdx-dict-parser"; | ||
|
||
const filePath = "./the/path/to/your/dictionary.mdx"; | ||
const data: DictRecord[] = parseMdict(filePath); | ||
const thirdRecord = data[3]; | ||
console.log(thirdRecord); // Print the third record. | ||
``` | ||
|
||
## Roadmap | ||
|
||
This project is planned to implement these following functions soon. | ||
|
||
- mdict 1.0 and 3.0 support. | ||
- Read details for mdict file. | ||
- MDD parser support. | ||
|
||
## LICENSE | ||
|
||
MIT@[但为君故](https://dreams.plus). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.