Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index out of range: no indices are valid: 0 #4

Open
winterdl opened this issue Mar 28, 2023 · 1 comment
Open

Index out of range: no indices are valid: 0 #4

winterdl opened this issue Mar 28, 2023 · 1 comment

Comments

@winterdl
Copy link

winterdl commented Mar 28, 2023

void main(List<String> args) {
  var parser = ArgParser();
  var results = parser.parse(args);

  var path = results.rest[0];
  var word = results.rest[1];

  var mdict = MdictReader(path);
  var result = mdict.query('agley');

  print(result);
}

dict files:

dict.zip

with this error message:

RangeError (index): Index out of range: no indices are valid: 0
#0      Uint8List.[] (dart:typed_data-patch/typed_data_patch.dart:3118:7)
#1      MdictReader._decompressBlock (package:mdict_reader/src/mdict_reader_base.dart:185:25)
#2      MdictReader._readRecord (package:mdict_reader/src/mdict_reader_base.dart:168:19)
#3      MdictReader.query.<anonymous closure> (package:mdict_reader/src/mdict_reader_base.dart:50:23)
#4      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#5      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#6      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#7      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#8      new List.of (dart:core-patch/array_patch.dart:52:28)
#9      ListIterable.toList (dart:_internal/iterable.dart:214:7)
#10     MdictReader.query (package:mdict_reader/src/mdict_reader_base.dart:51:10)
#11     main (file:///Users/admin/Downloads/mdict_reader-master1/mdict_reader-master/bin/test.dart:12:19)
#12     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#13     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)

the exception occur in _readRecord functions, the print('compress size $compressedSize'); always return 0.

@gsy13213009
Copy link

this library can't be use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants