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

read gzipped dictionaries #751

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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