protected function extendLexicon(array &$aLexicon) { $sPatchFile = Config::get('path.real.root') . Config::get('path.relative.root_to_app') . Config::get('path.relative.app_to_data') . Config::get('jsreal.lexicon.simple_nlg.extension.' . $this->sLanguage); $sJsonExtension = Filesystem::get($sPatchFile); $aExtension = Conversion::getArrayFromJson($sJsonExtension); $aLexicon = array_merge_recursive($aLexicon, $aExtension); }
protected function applyLexiconPatchToTestVerb(array &$aTestConjugatedVerb) { $aTenseList = array('p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'ps1', 'ps2', 'ps3', 'ps4', 'ps5', 'ps6', 's1', 's2', 's3', 's4', 's5', 's6', 'ip2', 'ip4', 'ip5', 'pr', 'pp'); $sPatchFile = Config::get('path.real.root') . Config::get('path.relative.root_to_app') . Config::get('path.relative.app_to_data') . Config::get('jsreal.lexicon.simple_nlg.patch.' . $this->sLanguage); $sJsonPatch = Filesystem::get($sPatchFile); $aPatch = Conversion::getArrayFromJson($sJsonPatch); foreach ($aPatch as $sUnit => $aInfo) { if (isset($aInfo['V'])) { foreach ($aInfo['V'] as $sTenseAndPerson => $sConjugatedVerb) { if (Arr::in($aTenseList, $sTenseAndPerson)) { $aTestConjugatedVerb[$sUnit][$sTenseAndPerson] = $sConjugatedVerb; } } } } }