julius icon indicating copy to clipboard operation
julius copied to clipboard

mkdfa parse error

Open OddLingo opened this issue 4 years ago • 5 comments

I have all commits up to July 1, "fixed charconv fails in mkbingram". When I run mkdfa.pl on my grammar and voca files I get this confusing output:

toki.grammar has 78 rules
toki.voca    has 13 categories and 218 words
---
Now parsing grammar file
Now modifying grammar to minimize states[11]
Error:       parse error
Error: cannot open "toki.dfa.tmp"
Now parsing grammar file
Now modifying grammar to minimize states[7]
Error:       parse error
Error: cannot open "toki.dfa.tmp"
---
no .dfa or .dict file generated

The "parse error" messages are not coming from mkdfa itself, maybe dfa_minimize. But the message does not say which file it was reading, or a line number, or what the error is.

OddLingo avatar Aug 11 '20 16:08 OddLingo

Does the error occurs in older versions, for example v4.5?

LeeAkinobu avatar Aug 12 '20 05:08 LeeAkinobu

I had not had this problem with previous versions, but these particular voca and grammar files are new. I have some older grammar and voca files from a previous project which used to work on earlier versions, maybe two years ago, but they also fail now with the same message.

The specific files I am using can be seen at voca and grammar. I am running this on Ubuntu Linux version 18.04.4.

OddLingo avatar Aug 12 '20 12:08 OddLingo

I just tried a trivial example, which ran ok:

% NS_B
s	sil
% NS_E
es	sil

% NEG
ala	ah l ah

and

S: NS_B NEG NEG NS_E

So now I know that it is something wrong with the format of my files that is causing it to fail (rather than give me a diagnostic as to what I am doing wrong).

OddLingo avatar Aug 12 '20 14:08 OddLingo

I think I have found it. I had an error in my grammar file where I had two terms to the left of the colon. Fixing that has it working properly again and giving sensible messages about my other mistakes.

OddLingo avatar Aug 12 '20 15:08 OddLingo

Found that the line 62 and 63 in the grammar causes error. BNF rule does not allow multiple words at the left of ":".

NP TRANSVP: VERB DO
NP TRANSVP: MODAL VERB DO

Now I'm updating the codes to output detailed information about grammar error, it will be included in the next release coming within a month.

LeeAkinobu avatar Aug 12 '20 16:08 LeeAkinobu