Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Terminal command to convert all graphs? #3

Closed
ppKrauss opened this issue Jan 11, 2018 · 4 comments
Closed

Terminal command to convert all graphs? #3

ppKrauss opened this issue Jan 11, 2018 · 4 comments

Comments

@ppKrauss
Copy link

Hi, I am testing Unitex-GramLab-3.1-linux-x86_64.run, it is fine in Ubuntu 16 LTS... Running with pt-BR ... At menu FSGraph menu/Tools/Compile FST2 no convertion, only error:

"Main graph matches epsilon! ERROR: the main graph A001 recognizes "

I need

  1. Avoid errors
  2. Compile and save all Graphs (to produce all FST2 files from pt-BR/Inflection/*.grf).
@eric-laporte
Copy link
Member

Hi Peter, the message says 'ERROR' but it's a warning: the correct compiled graph is generated.

@ppKrauss
Copy link
Author

Hi @eric-laporte , thanks. Perfect, now I am using -e option,

"/home/user/Unitex-GramLab-3.1/App/UnitexToolLogger" Grf2Fst2 -e "/home/user/workspace/Unitex-GramLab/Unitex/Portuguese (Brazil)/Inflection/A001D026.grf" -y "--alphabet=/home/user/workspace/Unitex-GramLab/Unitex/Portuguese (Brazil)/Alphabet.txt" -qutf8-no-bom

No error messages.

All graphs convertion

About "to convert all graphs?" of this issue (title), I tested Inflection/*.grf but "Compilation has failed", no * interpretation in the Grf2Fst2 command... The -d and -r options not seem as recursive, and test fail in "Invalid arguments".

I am using a shell script as workaround (after change the folder name to pt-BR):

#!/bin/bash
for NAME in $( ls *.grf | xargs readlink -f ); do
    "/home/user/Unitex-GramLab-3.1/App/UnitexToolLogger" Grf2Fst2 -e $NAME -y "--alphabet=/home/user/workspace/Unitex-GramLab/Unitex/pt-BR/Alphabet.txt" -qutf8-no-bom
done 

Naming and running it as sh convert_to_fst2.sh compiled all with success. Idem at Inflection/o1971 folder.


Now I need to understand how to interpret the "transducer language" of *.fst2 files... There are a good "fast guide" for it?

@eric-laporte
Copy link
Member

Yes, the user manual, section 14.3.2

@ppKrauss
Copy link
Author

Hi, thanks. We can close this question.


If there are no Grf2Fst2 option to do bulk convertions (convert all *.grf of a folder or from a list), and it is a good idea for other users, we can reopen to suggest an enhancement in the Grf2Fst2.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants