All Projects → KnIfER → Mdict Java

KnIfER / Mdict Java

Licence: gpl-3.0
Query library for Mdict (mdx or mdd) , a popular dictionary file format.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mdict Java

mdict
node.js mdict (*.mdx, *.mdd) file reader
Stars: ✭ 39 (-63.21%)
Mutual labels:  dictionary, mdx
js-mdict
*.mdx/*.mdd interpreter js implements
Stars: ✭ 91 (-14.15%)
Mutual labels:  dictionary, mdx
wikit
Wikit - A universal lookup tool
Stars: ✭ 149 (+40.57%)
Mutual labels:  dictionary, mdx
medict
medict a cross platform dictionary application,support mdict (*.mdx/*.mdd) dictionary format
Stars: ✭ 154 (+45.28%)
Mutual labels:  dictionary, mdx
Swiftforms
A small and lightweight library written in Swift that allows you to easily create forms.
Stars: ✭ 1,329 (+1153.77%)
Mutual labels:  dictionary
Lilak
Persian Spell Checking Dictionary
Stars: ✭ 86 (-18.87%)
Mutual labels:  dictionary
Pyglossary
A tool for converting dictionary files aka glossaries. The primary purpose is to be able to use our offline glossaries in any Open Source dictionary we like on any OS/device.
Stars: ✭ 1,257 (+1085.85%)
Mutual labels:  dictionary
Gatsby Mdx Netlify Cms Starter
Gatsby-MDX with Netlify CMS. Support React components in your CMS editor!
Stars: ✭ 84 (-20.75%)
Mutual labels:  mdx
Server Components Mdx Demo
React server components + MDX
Stars: ✭ 102 (-3.77%)
Mutual labels:  mdx
Gatsby Starter Portfolio Minimal
A Gatsby Starter to create a clean one-page portfolio with Markdown content.
Stars: ✭ 100 (-5.66%)
Mutual labels:  mdx
Eazydict
简单易用的命令行词典 📕 📙 📗 📘 📓
Stars: ✭ 92 (-13.21%)
Mutual labels:  dictionary
Nextra
The Next.js Static Site Generator
Stars: ✭ 1,271 (+1099.06%)
Mutual labels:  mdx
Yorubaname Website
Source code for YorubaName dictionary
Stars: ✭ 95 (-10.38%)
Mutual labels:  dictionary
Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (-19.81%)
Mutual labels:  dictionary
Gatsby Theme Chronoblog
⏳ Chronoblog is a Gatsbyjs theme specifically designed to create a personal website. The main idea of ​​Chronoblog is to allow you not only to write a personal blog but also to keep a record of everything important that you have done.
Stars: ✭ 101 (-4.72%)
Mutual labels:  mdx
Awesome Pronunciation
💬 How to pronounce Programming words?
Stars: ✭ 84 (-20.75%)
Mutual labels:  dictionary
Vscode Mdx
MDX for Visual Studio Code
Stars: ✭ 91 (-14.15%)
Mutual labels:  mdx
Weak Password
字典大全 dictionary
Stars: ✭ 100 (-5.66%)
Mutual labels:  dictionary
Gatsby Documentation Starter
Automatically generate docs for React components using MDX, react-docgen, and GatsbyJS
Stars: ✭ 91 (-14.15%)
Mutual labels:  mdx
Eslint Mdx
ESLint Parser/Plugin for MDX
Stars: ✭ 89 (-16.04%)
Mutual labels:  mdx

MDict Library in pure java !

image

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<mdict> mdxs = new ArrayList<>();
...
RBTree_additive combining_search_tree = new RBTree_additive();
for(int i=0;i<mdxs.size();i++)
{
  mdxs.get(i).size_confined_lookUp(key,combining_search_tree,i,30);
}  	
combining_search_tree.inOrder();//print results stored in the RBTree

/*printed results looks like 【[email protected]@[email protected]@[email protected]@1】...【other results】...
how to handle:
String html_contents0 = mdxs.get(0).getRecordAt(111);
...
...  
...
*/

details

  • This project was initially converted from xiaoqiangWang's python analyzer.
  • Use red-black tree and binary-list-searching(mainly) to implement dictionary funcitons.
  • Feng Dihai(@fengdh)'s mdict-js is of help too, I've just switched to use the same short but elegant binary-list-searching method——reduce().Somehow, this function always returns the first occurence of the entry >= 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].