How do you retrieve tags from JSGF grammars using sphinx?

风格不统一 提交于 2019-12-06 06:14:45

We removed tags, see Travis answer below.

The ability to parse tags has been removed according to the forums for the project.

Forum post discussing it not being a feature.

I wrote a library yesterday which maybe is what you need :

Link-> https://github.com/goxr3plus/JSFG-Grammar-Rules-Parser-Library-for-Sphinx4-5

Example code to use it(You can find more examples on the github) :

List<String> rules;

rules = JSGFGrammarParser.getAllGrammarRules(JSGFGrammarParserTester.class.getResourceAsStream("grammar1.gram"), false);
System.out.println("Grammar Rules , without definitions: " + rules + "\n");

rules = JSGFGrammarParser.getAllGrammarRules(JSGFGrammarParserTester.class.getResourceAsStream("grammar1.gram"), true);
System.out.println("Grammar Rules , with definitions: " + rules + "\n");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!