dict_reader 1.0.1 copy "dict_reader: ^1.0.1" to clipboard
dict_reader: ^1.0.1 copied to clipboard

Reading mdict files, support MDX/MDD file formats.

Dict_reader #

Pub Version

English | 中文

Reading mdict files, support MDX/MDD file formats.

Disadvantages #

These drawbacks don't affect general use :)

  • checksum ❌
  • lzo compression ❌
  • 3.0 version format ❌

Install #

dart pub add dict_reader

Usage #

Read Data Directly #

import 'package:dict_reader/dict_reader.dart';

void main() async {
  final dictReader = DictReader("MDX FILE PATH");
  await dictReader.init();

  await for (final (keyText, data) in dictReader.read(true)) {
    print("$keyText, $data");
  }
}

Read Data Offset, Read Data Later #

import 'package:dict_reader/dict_reader.dart';

void main() async {
  final dictReader = DictReader("MDX FILE PATH");
  await dictReader.init();

  final map = <String, (int, int, int, int)>{};
  await for (final (keyText, offset) in dictReader.read()) {
    map[keyText] = offset;
  }

  final offset = map["go"];
  print(await dictReader.readOne(offset!.$1, offset.$2, offset.$3, offset.$4));
}

Read Data After Stored Data Offset #

import 'package:dict_reader/dict_reader.dart';

// ...

void main() async {
  // ...

  final dictReader = DictReader("MDX FILE PATH");
  // Pass false to reduce initialization time
  await dictReader.init(false);

  final offset = map["go"];
  print(await dictReader.readOne(offset!.$1, offset.$2, offset.$3, offset.$4));
}
2
likes
0
pub points
65%
popularity

Publisher

verified publishermumulhl.eu.org

Reading mdict files, support MDX/MDD file formats.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

charset

More

Packages that depend on dict_reader