lol

Merge pull request #238378 from Lurkki14/lurkki/omorfi

omorfi: init at 0.9.9

authored by

Pol Dellaiera and committed by
GitHub
3ea8f62a ef4a59fa

+391
+6
maintainers/maintainer-list.nix
··· 9963 9963 githubId = 782440; 9964 9964 name = "Luna Nova"; 9965 9965 }; 9966 + lurkki = { 9967 + email = "jussi.kuokkanen@protonmail.com"; 9968 + github = "Lurkki14"; 9969 + githubId = 44469719; 9970 + name = "Jussi Kuokkanen"; 9971 + }; 9966 9972 lux = { 9967 9973 email = "lux@lux.name"; 9968 9974 github = "luxzeitlos";
+46
pkgs/development/libraries/hfst-ospell/default.nix
··· 1 + { lib 2 + , stdenv 3 + , autoreconfHook 4 + , fetchFromGitHub 5 + , icu 6 + , libarchive 7 + , pkg-config 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "hfst-ospell"; 12 + version = "0.5.3"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "hfst"; 16 + repo = "hfst-ospell"; 17 + rev = "refs/tags/v${finalAttrs.version}"; 18 + hash = "sha256-16H1nbAIe+G71+TnlLG0WnH9LktZwmc0d0O+oYduH1k="; 19 + }; 20 + 21 + buildInputs = [ 22 + icu 23 + libarchive 24 + ]; 25 + 26 + nativeBuildInputs = [ 27 + autoreconfHook 28 + pkg-config 29 + ]; 30 + 31 + # libxmlxx is listed as a dependency but Darwin build fails with it, 32 + # might also be better in general since libxmlxx in Nixpkgs is 8 years old 33 + # https://github.com/hfst/hfst-ospell/issues/48#issuecomment-546535653 34 + configureFlags = [ 35 + "--without-libxmlpp" 36 + "--without-tinyxml2" 37 + ]; 38 + 39 + meta = with lib; { 40 + homepage = "https://github.com/hfst/hfst-ospell/"; 41 + description = "HFST spell checker library and command line tool "; 42 + license = licenses.asl20; 43 + maintainers = with maintainers; [ lurkki ]; 44 + platforms = platforms.unix; 45 + }; 46 + })
+53
pkgs/development/libraries/hfst/default.nix
··· 1 + { lib 2 + , autoreconfHook 3 + , bison 4 + , flex 5 + , foma 6 + , fetchFromGitHub 7 + , gettext 8 + , icu 9 + , stdenv 10 + , swig 11 + , pkg-config 12 + , zlib 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "hfst"; 17 + version = "3.16.0"; 18 + 19 + src = fetchFromGitHub { 20 + owner = "hfst"; 21 + repo = "hfst"; 22 + rev = "refs/tags/v${finalAttrs.version}"; 23 + hash = "sha256-2ST0s08Pcp+hTn7rUTgPE1QkH6PPWtiuFezXV3QW0kU="; 24 + }; 25 + 26 + nativeBuildInputs = [ 27 + autoreconfHook 28 + bison 29 + flex 30 + pkg-config 31 + swig 32 + ]; 33 + 34 + buildInputs = [ 35 + foma 36 + gettext 37 + icu 38 + zlib 39 + ]; 40 + 41 + configureFlags = [ 42 + "--enable-all-tools" 43 + "--with-foma-upstream=true" 44 + ]; 45 + 46 + meta = with lib; { 47 + description = "FST language processing library"; 48 + homepage = "https://github.com/hfst/hfst"; 49 + license = licenses.gpl3Plus; 50 + maintainers = with maintainers; [ lurkki ]; 51 + platforms = platforms.unix; 52 + }; 53 + })
+40
pkgs/development/libraries/libvoikko/default.nix
··· 1 + { stdenv 2 + , lib 3 + , autoreconfHook 4 + , hfst-ospell 5 + , fetchFromGitHub 6 + , pkg-config 7 + , python3 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "libvoikko"; 12 + version = "4.3.2"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "voikko"; 16 + repo = "corevoikko"; 17 + rev = "refs/tags/rel-libvoikko-${finalAttrs.version}"; 18 + hash = "sha256-0MIQ54dCxyAfdgYWmmTVF+Yfa15K2sjJyP1JNxwHP2M="; 19 + }; 20 + 21 + sourceRoot = "${finalAttrs.src.name}/libvoikko"; 22 + 23 + nativeBuildInputs = [ 24 + autoreconfHook 25 + pkg-config 26 + python3 27 + ]; 28 + 29 + buildInputs = [ 30 + hfst-ospell 31 + ]; 32 + 33 + meta = with lib; { 34 + homepage = "https://voikko.puimula.org/"; 35 + description = "Finnish language processing library"; 36 + license = licenses.lgpl21Plus; 37 + maintainers = with maintainers; [ lurkki ]; 38 + platforms = platforms.unix; 39 + }; 40 + })
+81
pkgs/development/libraries/omorfi/default.nix
··· 1 + { lib 2 + , stdenv 3 + , autoreconfHook 4 + , cg3 5 + , fetchFromGitHub 6 + , hfst 7 + , hfst-ospell 8 + , icu 9 + , libvoikko 10 + , makeWrapper 11 + , pkg-config 12 + , python3 13 + , zip 14 + }: 15 + 16 + stdenv.mkDerivation (finalAttrs: { 17 + pname = "omorfi"; 18 + version = "0.9.9"; 19 + 20 + src = fetchFromGitHub { 21 + owner = "flammie"; 22 + repo = "omorfi"; 23 + rev = "refs/tags/v${finalAttrs.version}"; 24 + hash = "sha256-UoqdwNWCNOPX6u1YBlnXUcB/fmcvcy/HXbYciVrMBOY="; 25 + }; 26 + 27 + # Fix for omorfi-hyphenate.sh file not found error 28 + postInstall = '' 29 + ln -s $out/share/omorfi/{omorfi.hyphenate-rules.hfst,omorfi.hyphenate.hfst} 30 + ''; 31 + 32 + nativeBuildInputs = [ 33 + autoreconfHook 34 + cg3 35 + makeWrapper 36 + pkg-config 37 + python3 38 + zip 39 + python3.pkgs.wrapPython 40 + ]; 41 + 42 + buildInputs = [ 43 + python3.pkgs.hfst 44 + hfst-ospell 45 + libvoikko 46 + ]; 47 + 48 + # Supplied pkg-config file doesn't properly expose these 49 + propagatedBuildInputs = [ 50 + hfst 51 + icu 52 + ]; 53 + 54 + # Wrap shell scripts so they find the Python scripts 55 + # omorfi.bash inexplicably fails when wrapped 56 + preFixup = '' 57 + wrapPythonProgramsIn "$out/bin" "$out ${python3.pkgs.hfst}" 58 + for i in "$out/bin"/*.{sh,bash}; do 59 + if [ $(basename "$i") != "omorfi.bash" ]; then 60 + wrapProgram "$i" --prefix "PATH" : "$out/bin/" 61 + fi 62 + done 63 + ''; 64 + 65 + # Enable all features 66 + configureFlags = [ 67 + "--enable-labeled-segments" 68 + "--enable-lemmatiser" 69 + "--enable-segmenter" 70 + "--enable-hyphenator" 71 + ]; 72 + 73 + meta = with lib; { 74 + description = "Analysis for Finnish text"; 75 + homepage = "https://github.com/flammie/omorfi"; 76 + license = licenses.gpl3; 77 + maintainers = with maintainers; [ lurkki ]; 78 + # Darwin build fails due to hfst not being found 79 + broken = stdenv.isDarwin; 80 + }; 81 + })
+45
pkgs/development/python-modules/hfst/default.nix
··· 1 + { lib 2 + , pkgs 3 + , stdenv 4 + , buildPythonPackage 5 + , foma 6 + , icu 7 + , swig 8 + }: 9 + 10 + buildPythonPackage rec { 11 + pname = "hfst"; 12 + inherit (pkgs.hfst) version src; 13 + 14 + sourceRoot = "${src.name}/python"; 15 + 16 + postPatch = '' 17 + # omorfi-python looks for 'hfst' Python package 18 + sed -i 's/libhfst_swig/hfst/' setup.py; 19 + ''; 20 + 21 + nativeBuildInputs = [ 22 + swig 23 + ]; 24 + 25 + buildInputs = [ 26 + icu 27 + pkgs.hfst 28 + ]; 29 + 30 + setupPyBuildFlags = [ 31 + "--inplace" 32 + ]; 33 + 34 + # Find foma in Darwin tests 35 + preCheck = lib.optionalString stdenv.isDarwin '' 36 + export DYLD_LIBRARY_PATH="${foma}/lib" 37 + ''; 38 + 39 + meta = with lib; { 40 + description = "Python bindings for HFST"; 41 + homepage = "https://github.com/hfst/hfst"; 42 + license = licenses.gpl3; 43 + maintainers = with maintainers; [ lurkki ]; 44 + }; 45 + }
+32
pkgs/development/python-modules/omorfi/default.nix
··· 1 + { buildPythonPackage 2 + , pkgs 3 + , lib 4 + , stdenv 5 + , hfst 6 + }: 7 + 8 + buildPythonPackage rec { 9 + pname = "omorfi"; 10 + inherit (pkgs.omorfi) src version; 11 + 12 + sourceRoot = "${src.name}/src/python"; 13 + 14 + propagatedBuildInputs = [ 15 + hfst 16 + ]; 17 + 18 + # Fixes some improper import paths 19 + patches = [ ./importfix.patch ]; 20 + 21 + # Apply patch relative to source/src 22 + patchFlags = [ "-p3" ]; 23 + 24 + meta = with lib; { 25 + description = "Python interface for Omorfi"; 26 + homepage = "https://github.com/flammie/omorfi"; 27 + license = licenses.gpl3; 28 + maintainers = with maintainers; [ lurkki ]; 29 + # Ofborg build error (hfst not found?) 30 + broken = stdenv.isDarwin; 31 + }; 32 + }
+76
pkgs/development/python-modules/omorfi/importfix.patch
··· 1 + diff --git a/src/python/omorfi/entryguessing/gradation.py b/src/python/omorfi/entryguessing/gradation.py 2 + index 7d3ed8cb..825d7ead 100755 3 + --- a/src/python/omorfi/entryguessing/gradation.py 4 + +++ b/src/python/omorfi/entryguessing/gradation.py 5 + @@ -17,8 +17,8 @@ 6 + # You should have received a copy of the GNU General Public License 7 + # along with this program. If not, see <http://www.gnu.org/licenses/>. 8 + 9 + -from .omorfi.error_logging import fail_guess_because 10 + -from .omorfi.string_mangling import replace_rightmost, replace_rightmosts 11 + +from omorfi.error_logging import fail_guess_because 12 + +from omorfi.string_manglers import replace_rightmost, replace_rightmosts 13 + 14 + 15 + def gradation_make_morphophonemes(wordmap): 16 + diff --git a/src/python/omorfi/entryguessing/guess_new_class.py b/src/python/omorfi/entryguessing/guess_new_class.py 17 + index 1884716b..3a781bfc 100755 18 + --- a/src/python/omorfi/entryguessing/guess_new_class.py 19 + +++ b/src/python/omorfi/entryguessing/guess_new_class.py 20 + @@ -17,8 +17,8 @@ 21 + # You should have received a copy of the GNU General Public License 22 + # along with this program. If not, see <http://www.gnu.org/licenses/>. 23 + 24 + -from .error_logging import fail_guess_because 25 + -from .string_manglers import three_syllable 26 + +from omorfi.error_logging import fail_guess_because 27 + +from omorfi.string_manglers import three_syllable 28 + 29 + 30 + def guess_new_class(wordmap): 31 + diff --git a/src/python/omorfi/entryguessing/plurale_tantum.py b/src/python/omorfi/entryguessing/plurale_tantum.py 32 + index a8af81fb..95fc4b7b 100755 33 + --- a/src/python/omorfi/entryguessing/plurale_tantum.py 34 + +++ b/src/python/omorfi/entryguessing/plurale_tantum.py 35 + @@ -17,8 +17,8 @@ 36 + # You should have received a copy of the GNU General Public License 37 + # along with this program. If not, see <http://www.gnu.org/licenses/>. 38 + 39 + -from .error_logging import fail_guess_because 40 + -from .omorfi.string_manglers import replace_rightmost, replace_rightmosts 41 + +from omorfi.error_logging import fail_guess_because 42 + +from omorfi.string_manglers import replace_rightmost, replace_rightmosts 43 + 44 + 45 + def plurale_tantum_get_singular_stem(wordmap): 46 + diff --git a/src/python/omorfi/formats/experimental_xml_formatter.py b/src/python/omorfi/formats/experimental_xml_formatter.py 47 + index abccbff5..11b0f518 100755 48 + --- a/src/python/omorfi/formats/experimental_xml_formatter.py 49 + +++ b/src/python/omorfi/formats/experimental_xml_formatter.py 50 + @@ -19,9 +19,9 @@ 51 + 52 + from xml.sax.saxutils import escape as xml_escape 53 + 54 + -from ftb3_formatter import Ftb3Formatter 55 + +from .ftb3_formatter import Ftb3Formatter 56 + 57 + -from .settings import version_id_easter_egg 58 + +from omorfi.settings import version_id_easter_egg 59 + 60 + 61 + def make_xmlid(s): 62 + diff --git a/src/python/omorfi/formats/lexc_formatter.py b/src/python/omorfi/formats/lexc_formatter.py 63 + index 4ec616b7..b146129f 100755 64 + --- a/src/python/omorfi/formats/lexc_formatter.py 65 + +++ b/src/python/omorfi/formats/lexc_formatter.py 66 + @@ -19,8 +19,8 @@ 67 + 68 + # functions for formatting the database data to lexc 69 + 70 + -from .settings import deriv_boundary, morph_boundary, newword_boundary, optional_hyphen, stub_boundary, word_boundary 71 + -from .string_manglers import lexc_escape 72 + +from omorfi.settings import deriv_boundary, morph_boundary, newword_boundary, optional_hyphen, stub_boundary, word_boundary 73 + +from omorfi.string_manglers import lexc_escape 74 + 75 + 76 + def format_copyright_lexc():
+8
pkgs/top-level/all-packages.nix
··· 41577 41577 41578 41578 charasay = callPackage ../tools/misc/charasay { }; 41579 41579 41580 + libvoikko = callPackage ../development/libraries/libvoikko { }; 41581 + 41582 + hfst = callPackage ../development/libraries/hfst { }; 41583 + 41584 + omorfi = callPackage ../development/libraries/omorfi { }; 41585 + 41586 + hfst-ospell = callPackage ../development/libraries/hfst-ospell { }; 41587 + 41580 41588 waylyrics = callPackage ../applications/audio/waylyrics { }; 41581 41589 41582 41590 gitrs = callPackage ../tools/misc/gitrs { };
+4
pkgs/top-level/python-packages.nix
··· 4718 4718 4719 4719 hexdump = callPackage ../development/python-modules/hexdump { }; 4720 4720 4721 + hfst = callPackage ../development/python-modules/hfst { }; 4722 + 4721 4723 hg-commitsigs = callPackage ../development/python-modules/hg-commitsigs { }; 4722 4724 4723 4725 hg-evolve = callPackage ../development/python-modules/hg-evolve { }; ··· 7281 7283 omnikinverter = callPackage ../development/python-modules/omnikinverter { }; 7282 7284 7283 7285 omnilogic = callPackage ../development/python-modules/omnilogic { }; 7286 + 7287 + omorfi = callPackage ../development/python-modules/omorfi { }; 7284 7288 7285 7289 omrdatasettools = callPackage ../development/python-modules/omrdatasettools { }; 7286 7290