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

German Dictionary for Hunspell #36155

Merged
merged 3 commits into from Mar 1, 2018
Merged

German Dictionary for Hunspell #36155

merged 3 commits into from Mar 1, 2018

Conversation

timor
Copy link
Member

@timor timor commented Mar 1, 2018

Motivation for this change

Add german dictionary to hunspell.

Things done

Building these dicts needs ispell, so I re-used the PR #3320 for that.
For the actual dict, used the code from this: #32777

Tested by building hunspell with german and en-US dictionaries on 17.09 and master and running hunspell -D, which then shows the german dictionary. Also tested actual spelling correction, which gives the same result as the online spell checker (https://j3e.de/cgi-bin/spellchecker)

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@timor
Copy link
Member Author

timor commented Mar 1, 2018

This PR would introduce ispell as a top-level package although it is only used (not even the latest version) for building the dictionary. Is that acceptable? Should ispell be only a local derivation in dictionaries.nix? If so, what is the best way to do that?

@timor
Copy link
Member Author

timor commented Mar 1, 2018

cc @Fuuzetsu

Copy link
Member

@Fuuzetsu Fuuzetsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok with me the way it is in this PR.

@timor timor changed the title [WIP] german dictionary for hunspell German Dictionary for Hunspell Mar 1, 2018
@globin
Copy link
Member

globin commented Mar 1, 2018

@GrahamcOfBorg build hunspellDicts.de-de ispell

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

cc -O -c term.c
term.c:95:10: fatal error: 'termio.h' file not found
#include <termio.h>
         ^~~~~~~~~~
1 error generated.
term.c wouldn't compile.  Try inverting USG in local.h
make: *** [Makefile:588: term.o] Error 1
builder for '/nix/store/v6myjkbpb0hypy4r6bqwc657njv07chh-ispell-3.3.02.drv' failed with exit code 2
cannot build derivation '/nix/store/siv7bn1v3p5ghqwlajh0vin1ib389l3r-hunspell-dict-de-de-j3e-20161207.drv': 1 dependencies couldn't be built
error: build of '/nix/store/siv7bn1v3p5ghqwlajh0vin1ib389l3r-hunspell-dict-de-de-j3e-20161207.drv', '/nix/store/v6myjkbpb0hypy4r6bqwc657njv07chh-ispell-3.3.02.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

Capital prefixes will be expanded: Zufriedenheit/UPm
Capital prefixes will be expanded: Zug/SETVpm
Capital prefixes will be expanded: Zuga"nglichkeit/Um
Capital prefixes will be expanded: Zula"ssigkeit/Um
Capital prefixes will be expanded: Zuverla"ssigkeit/PUm
sed -n '$=' < hunspell/de_DE.dic.tmp > hunspell/de_DE.dic
cat myspell/de_all.dic.header | sed "s/AFF_VERSION_REPLACE/`cat VERSION`/;s/LANG_REPLACE/de_DE/;s/Myspell/Hunspell/" >> hunspell/de_DE.dic
sed -f ./bin/dic2iso < hunspell/de_DE.dic.tmp >> hunspell/de_DE.dic
'/nix/store/hb7kmc3i8hbb0rk48kf0gmgm71zf1c21-hunspell-dict-de-de-j3e-20161207/share/myspell/dicts/de_DE.dic' -> '/nix/store/hb7kmc3i8hbb0rk48kf0gmgm71zf1c21-hunspell-dict-de-de-j3e-20161207/share/hunspell/de_DE.dic'
'/nix/store/hb7kmc3i8hbb0rk48kf0gmgm71zf1c21-hunspell-dict-de-de-j3e-20161207/share/myspell/dicts/de_DE.aff' -> '/nix/store/hb7kmc3i8hbb0rk48kf0gmgm71zf1c21-hunspell-dict-de-de-j3e-20161207/share/hunspell/de_DE.aff'

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

Capital prefixes will be expanded: Zufriedenheit/UPm
Capital prefixes will be expanded: Zug/SETVpm
Capital prefixes will be expanded: Zuga"nglichkeit/Um
Capital prefixes will be expanded: Zula"ssigkeit/Um
Capital prefixes will be expanded: Zuverla"ssigkeit/PUm
sed -n '$=' < hunspell/de_DE.dic.tmp > hunspell/de_DE.dic
cat myspell/de_all.dic.header | sed "s/AFF_VERSION_REPLACE/`cat VERSION`/;s/LANG_REPLACE/de_DE/;s/Myspell/Hunspell/" >> hunspell/de_DE.dic
sed -f ./bin/dic2iso < hunspell/de_DE.dic.tmp >> hunspell/de_DE.dic
'/nix/store/hk61rs52lgdn8mfn4dfjws0n4xpmica0-hunspell-dict-de-de-j3e-20161207/share/myspell/dicts/de_DE.dic' -> '/nix/store/hk61rs52lgdn8mfn4dfjws0n4xpmica0-hunspell-dict-de-de-j3e-20161207/share/hunspell/de_DE.dic'
'/nix/store/hk61rs52lgdn8mfn4dfjws0n4xpmica0-hunspell-dict-de-de-j3e-20161207/share/myspell/dicts/de_DE.aff' -> '/nix/store/hk61rs52lgdn8mfn4dfjws0n4xpmica0-hunspell-dict-de-de-j3e-20161207/share/hunspell/de_DE.aff'

#sed -i -e 's| *extern int\s*strcmp.*||' ijoin.c

#XXX: buildhash uses int to store pointers, which doesn't work on 64bit
#sed -i -e 's|\s*int\s*strptr|intptr_t strptr|' -e 's|\s*int\s*x|intptr_t x|' buildhash.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them.

bennofs and others added 2 commits March 1, 2018 15:28
Note that this relies on ispell as a dependency.  Also, perl and hunspell itself
are used during building the dictionary.
@globin globin merged commit 76a01ad into NixOS:master Mar 1, 2018
{ stdenv, fetchurl, bison, ncurses }:

stdenv.mkDerivation rec {
name = "ispell-3.3.02";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outdated, current version is 3.4.00: https://www.cs.hmc.edu/~geoff/ispell.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The reason why I did not try to use the newest one is that ispell here is only used as a build dependency for the dictionary. So I basically stuck to the version that someone else deemed working.

@timor timor deleted the hunspell branch February 8, 2019 22:06
@jtojnar jtojnar mentioned this pull request Feb 2, 2020
10 tasks
tadeokondrak added a commit to tadeokondrak/nixpkgs that referenced this pull request Feb 8, 2021
This was added only to build hunspellDicts.de_DE: [1]
The patches came from an older PR (taken from Debian): [2]
but aren't needed to build the dictionary.

[1]: NixOS#36155
[2]: NixOS#3320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants