Skip to content

read gzipped dictionaries#751

Open
flachs wants to merge 1 commit intohunspell:masterfrom
flachs:gzipped-dict
Open

read gzipped dictionaries#751
flachs wants to merge 1 commit intohunspell:masterfrom
flachs:gzipped-dict

Conversation

@flachs
Copy link

@flachs flachs commented Nov 8, 2021

This code implements a 'smart-open' sort of feature for dictionary files.
ending with .hz => open with hzip
ending with .gz => open with popen("gunzip -c")
otherwise attempt to open as a file,
if this fails, attempt to open .hz with hzip
if this fails, attempt to open .gz with popen("gunzip -c")

@flachs flachs closed this Nov 8, 2021
@flachs flachs reopened this Nov 8, 2021
@flachs
Copy link
Author

flachs commented Nov 8, 2021

tests passed

@drahnr
Copy link

drahnr commented Sep 18, 2022

Wouldn't this functionality be better suited as part of the demo application rather than pulling in the requirement to depend on an external tool being installed for the library?

@ssvb
Copy link

ssvb commented May 10, 2023

A better solution would be to use zlib. But that's an extra library dependence for Hunspell.

@flachs
Copy link
Author

flachs commented May 11, 2023

This patch was designed to allow operation with a very small amount of disk space so unpacking the data before loading it is out of the question. gzip is already present (and very commonly present), and the fork is very low overhead.

@ssvb
Copy link

ssvb commented May 11, 2023

Of course unpacking data into temporary files on disk is unacceptable. But starting other processes is also unacceptable, because this is fragile, system dependent and may have security implications. Is there really no zlib library installed on your system to do unpacking on-the-flight inside of hunspell?

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

Successfully merging this pull request may close these issues.

3 participants