Hyphenation question

4 views
Skip to first unread message

Andrew Hinkley

unread,
May 19, 2024, 12:57:20 AMMay 19
to gregori...@googlegroups.com
I'd like to use hyphen-la to automate hyphenation, but I can't figure out how to use it from the Linux commandline. I tried 
$ ./syllabify.py -t chant -m liturgical
I get
  File "/home/ahinkley/Downloads/Git/hyphen-la/scripts/./syllabify.py", line 157, in <module>
   hyphenator = pyphen.Pyphen(filename=dir_path+'/../patterns/hyph_la_'+args.mode+'.dic',left=lefthyphenmin,right=righthyphenmin)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/pyphen/__init__.py", line 223, in __init__
   hdcache[filename] = HyphDict(filename)
                       ^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/pyphen/__init__.py", line 118, in __init__
   encoding = path.open('rb').readline().decode()
              ^^^^^^^^^
AttributeError: 'str' object has no attribute 'open'

Suppose I want to send a string as input and have it output to the terminal (or a file), what command should I be using?

Also, do I need to run make before I use the scripts?

Thank you,
Andrew.

Arnaud de Castelbajac

unread,
May 22, 2024, 7:15:30 AMMay 22
to Gregorio Users
Hi Andrew,

You can type ./syllabify.py -h to see all the options of the script. In your case I think you need to type ./syllabify.py -i yourfile.txt -o outputfile.txt as -t chant and -m lirturgical atre the default options. I tried it just now on my computer and it works.
Please verify all the dependancies are satisfied to perform this action (available in the Readme).

Let me know if you need further assistance,

Arnaud

Rev. Elijah Schwab, O.Carm.

unread,
May 22, 2024, 7:15:37 AMMay 22
to gregori...@googlegroups.com
Not having used this tool myself:

You need to run `make all` in the `/Git/hyphen-la` dir. 

Instead of:
$ ./syllabify.py -t chant -m liturgical

Try:
$ ./syllabify.py -i <file-to-syllabate> -o <syllabated-file.gabc>

chant and liturgical are defaults, so not necessary to give on the command line. You can omit -o <syllabated-file.gabc> to test, which will print the output to stdout (terminal) for review.

--
Gregorio homepage: http://gregorio-project.github.io
Archives for the old mailing list: http://www.mail-archive.com/gregori...@gna.org/
To report a bug, please post to: https://github.com/gregorio-project/gregorio/issues
---
You received this message because you are subscribed to the Google Groups "Gregorio Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gregorio-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gregorio-users/CAHEM0JeOswDOeDoB%3Dra%3DXq9UcR_9cVzXFv3P-4U34h88Gtzizg%40mail.gmail.com.

Andrew Hinkley

unread,
May 23, 2024, 10:46:23 AMMay 23
to gregori...@googlegroups.com
I ran make all, make check_all, and make test and I still get exactly the same error. I think there's a dependency missing but I can't figure out what. I have pyphen installed (via an openSuSE package). 

Reply all
Reply to author
Forward
0 new messages