mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
tried to ameliorate syllabe counter
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
{ lib
|
||||||
|
, python3Packages
|
||||||
|
, fetchFromGitLab
|
||||||
|
, frhyme
|
||||||
|
, haspirater
|
||||||
|
}:
|
||||||
|
|
||||||
|
python3Packages.buildPythonApplication rec {
|
||||||
|
pname = "plint";
|
||||||
|
|
||||||
|
# No PyPI version mentioned; upstream is git-based
|
||||||
|
version = "unstable-2026-04-28";
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
owner = "a3nm";
|
||||||
|
repo = "plint";
|
||||||
|
rev = "master";
|
||||||
|
sha256 = lib.fakeSha256; # replace after first build
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
frhyme
|
||||||
|
haspirater
|
||||||
|
python3Packages.cherrypy
|
||||||
|
];
|
||||||
|
|
||||||
|
# plint uses scripts + data generation steps, so disable strict tests
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
# required data generation steps from README
|
||||||
|
echo "Generating frhyme.json..."
|
||||||
|
(cd frhyme/lexique && ./lexique_retrieve.sh > lexique.txt)
|
||||||
|
(cd frhyme && ./make.sh 4 lexique/lexique.txt additions > frhyme.json)
|
||||||
|
|
||||||
|
echo "Generating occurrences file..."
|
||||||
|
./lexique_occurrences_retrieve.sh > data/occurrences || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# ensure CLI entry point exists
|
||||||
|
install -Dm755 plint.py $out/bin/plint
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "French poetry validator (metrics, rhymes, template checking)";
|
||||||
|
homepage = "https://gitlab.com/a3nm/plint";
|
||||||
|
license = licenses.gpl3Plus;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
/* old version
|
|
||||||
{ pkgs, python3Packages, ... }:
|
{ pkgs, python3Packages, ... }:
|
||||||
|
|
||||||
pkgs.writers.writePython3Bin "custom-syllabes" {
|
pkgs.writers.writePython3Bin "custom-syllabes" {
|
||||||
@@ -23,7 +22,7 @@ for w in text.split():
|
|||||||
total += len(parts)
|
total += len(parts)
|
||||||
|
|
||||||
print(f"{total} ({'/'.join(chunks)})")
|
print(f"{total} ({'/'.join(chunks)})")
|
||||||
''*/
|
''
|
||||||
/* used IPA but had a deprecated dependency
|
/* used IPA but had a deprecated dependency
|
||||||
{ pkgs, python3Packages, ... }:
|
{ pkgs, python3Packages, ... }:
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ for word in text.split():
|
|||||||
|
|
||||||
print(f"{total} ({' | '.join(chunks)})")
|
print(f"{total} ({' | '.join(chunks)})")
|
||||||
''*/
|
''*/
|
||||||
{ pkgs, ... }:
|
/*{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
lexique = pkgs.fetchurl {
|
lexique = pkgs.fetchurl {
|
||||||
@@ -171,4 +170,4 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
''
|
''*/
|
||||||
|
|||||||
Reference in New Issue
Block a user