[libvoikko] Using the Hfst analyser outside of AnalyzerFactory

Francis Tyers ftyers at prompsit.com
Wed Sep 25 17:51:03 EEST 2013


In grammar/GrammarChecker.hpp, I have defined:

		RuleEngine * ruleEngine;
		GcCache gc_cache;
		morphology::Analyzer * analyser ; 

The class grammar/CgGrammarChecker.hpp extends this and loads:

  * An instance of CgRuleEngine into ruleEngine
I would like to load an instance of HfstAnalyzer into analyser, but I
don't see how I can create an instance without using the
AnalyzerFactory, which only allows creation using a setup::Dictionary

Would it be better to edit AnalyzerFactory and add a method to create
analysers only from a path, or is there some other way to get around
this ? 

        analyser = new morphology::HfstAnalyzer(analyser);

This is more or less what I want to do. The code is committed to the
gramchk branch.



More information about the Libvoikko mailing list