dictation-toolbox / dragonfly

Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS), Windows Speech Recognition (WSR), Kaldi and CMU Pocket Sphinx
GNU Lesser General Public License v3.0
388 stars 75 forks source link

Move internal lark parser grammar into parsing/parse.py #347

Closed drmfinlay closed 3 years ago

drmfinlay commented 3 years ago

CC @mrob95

Re: #169, #170.

This grammar has been moved from the parsing/grammar.lark file, which has now been removed. The grammar is used internally for parsing Compound element specifications efficiently.

This has been done because the file approach causes issues in some cases. It is also just simpler to have this grammar and the only code that uses it both in the same Python module.

daanzu commented 3 years ago

Good fix, thanks @Danesprite!

drmfinlay commented 3 years ago

Thanks, though these changes are essentially the same as those in PR #169, by @mrob95.

I wonder if there might be similar problems with dragonfly/engines/backend_kaldi/kag_version.txt.

daanzu commented 3 years ago

@Danesprite Yes, kag_version has the same problem. What is your preferred solution for handling it?

drmfinlay commented 3 years ago

@daanzu Okay then. The simplest solution would seem to be maintaining the required KAG version in both setup.py and backend_kaldi/engine.py. It is not as if it's updated regularly enough for this to cause problems.

daanzu commented 3 years ago

@Danesprite That makes sense; sounds good to me.

drmfinlay commented 3 years ago

@daanzu Okay then. I'll make the necessary changes.