Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knifer/mdict-java
Query library for Mdict (mdx or mdd) , a popular dictionary file format.
https://github.com/knifer/mdict-java
dictionary mdd mdict-android mdict-reader mdx mdxbuilder
Last synced: 10 days ago
JSON representation
Query library for Mdict (mdx or mdd) , a popular dictionary file format.
- Host: GitHub
- URL: https://github.com/knifer/mdict-java
- Owner: KnIfER
- License: gpl-3.0
- Created: 2017-11-22T17:26:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T10:09:33.000Z (over 1 year ago)
- Last Synced: 2025-01-02T16:13:55.662Z (18 days ago)
- Topics: dictionary, mdd, mdict-android, mdict-reader, mdx, mdxbuilder
- Language: Java
- Homepage:
- Size: 28.6 MB
- Stars: 166
- Watchers: 11
- Forks: 52
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: News.md
- License: License.txt
Awesome Lists containing this project
README
# MDict Library in pure java !
![image](https://github.com/KnIfER/mdict-java/raw/master/screenshots/PDPC.png)
It supports:
I.Lzo compressed contents. (via lzo-core)
II.Ripemd128 key-info decryption.
III.Builders to make Mdx add Mdd.and is able to do:
I.Basic query.
II.Conjuction search.
III.Fast wildcard match among entries.
IV.Fast Fulltext retrieval. (also with wild cards)# Android App
https://github.com/KnIfER/PlainDictionaryAPP# Usage:
### 1.Basic query:
```
String key = "happy";
mdict md = new mdict(path);
int search_result = md.lookUp(key, true);//true means to match strictly
if(search_result>=0){
String html_contents = md.getRecordAt(search_result);
String entry_name = md.getEntryAt(search_result);
}
```
### 2.Search in a bunch of dicts:
```
key = "happy";
ArrayList mdxs = new ArrayList<>();
...
RBTree_additive combining_search_tree = new RBTree_additive();
for(int i=0;i= keyword, in a pre-sorted list that contain entries. maybe some mathematician could tell me why, but I've tested over 100000 times without any expectation.
* Maybe I should oneday replace red-black tree and the recursive reduce method with `Arrays.binarySearch`, but I am lazy...
```
/*via mdict-js
*note at first time we feed in 0 as start and array.length as end. it must not be array.length-1.
*/
public static int reduce(int phrase, int[] array,int start,int end) {
int len = end-start;
if (len > 1) {
len = len >> 1;
return phrase > array[start + len - 1]
? reduce(phrase,array,start+len,end)
: reduce(phrase,array,start,start+len);
} else {
return start;
}
}
```
MDX File Format
===============MDD File Format
===============Source Code License:
Apache2.0 for the core part, specifically anything under the package of com.knziha.plod.dictionary.*; GPL3.0 for everything else including the mdictBuilder, UI part, and the android application.
As for the License of mdx file format itself, well, you know, mdict is an open dictionary platform.