Expand description
Parse and decode *.index files.
Each dictionary file (*.dict.dz)) is accompanied by a *.index file containing a list of
words, together with its (byte) position in the dict file and its (byte) length. This module
provides functions to parse this index file.
The position and the length of a definition is given in a semi-base64 encoding. It uses all
Latin letters (upper and lower case), all digits and additionally, + and /:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
The calculation works as follows: sum += x * 64^i
iis the position within the string to calculate the number from and counts from right to left, starting at 0.xis the index within the array given above, i.e.'a' == 26.
The sum makes up the index.
Structs§
Traits§
Functions§
- decode_
number - Decode a number from a given String.
- get_
base 🔒 - Get the assigned number for a character If the character was unknown, an empty Err(()) is returned.
- normalize 🔒
- parse_
index - Parse the index for a dictionary from a given BufRead compatible object.
When
lazyistrue, the loop stops once all the metadata entries are parsed. - parse_
index_ from_ file - Parse the index for a dictionary from a given path.
- parse_
line 🔒 - Parse a single line from the index file.