public function applyOnStem($stem) { // Ex. : qaujisaqtau + innaq > qaujisaqtaunginnaq // innaq : actionOnStem = n, actionVV = i(ng) // Appliquer l'actionOnStem (de la forme2) � la forme1 : qaujisaqtau // Appliquer l'actionVV (de la forme2) au r�sultat de l'actionOnStem : qaujisaqtaunginnaq $logger = Logger::getLogger('Action.combiner'); $logger->debug("\$stem= '{$stem}'"); $new_stem = ''; $suffix = $this->formOfAffix; $new_stem = $this->actionOnStem->applyOnStem($stem, $this->formOfAffix); if (strlen($new_stem) > 2 && Roman::isVowel(substr($new_stem, strlen($new_stem) - 1, 1)) && Roman::isVowel(substr($new_stem, strlen($new_stem) - 2, 1))) { if ($this->actionVV != null) { $new_stem = $this->actionVV->applyOnStem($new_stem, $this->formOfAffix); $suffix = $this->actionVV->surfaceForm($suffix); } } else { if ($this->actionNotVV != null) { $new_stem = $this->actionNotVV->applyOnStem($new_stem, $this->formOfAffix); $suffix = $this->actionNotVV->surfaceForm($suffix); } } $new_stem .= $suffix; return $new_stem; }
public function combine($form1, $form2, $act2) { // Ex.: _V + k > _VVk if (strlen($form1) < 2) { return $form1 . $form1[strlen($form1) - 1] . $form2; } elseif (!Roman::isVowel($form1[strlen($form1) - 2])) { return $form1 . $form1[strlen($form1) - 1] . $form2; } else { return $form1 . $form2; } }
public function addToStem($stem) { // Appliquer l'action1 et l'action2. // D'abord appliquer l'action1 : $logger = Logger::getLogger('Affix.addToStem'); $expressions = array(); $final = $stem[strlen($stem) - 1]; if (Roman::isVowel($final)) { $final = 'V'; } $behaviours_for_context = $this->behaviours_for_context($final); $logger->debug("behaviours pour '{$final}' : " . count($behaviours_for_context)); foreach ($behaviours_for_context as $a_behaviour) { $new_stem = $a_behaviour->applyOnStem($stem); $logger->debug("\$new_stem= '{$new_stem}'"); array_push($expressions, $new_stem); } return $expressions; }
public function testEstVoyelle() { $res = Roman::isVowel('i'); $this->assertTrue($res, "Erreur : 'i' est une voyelle."); }
/** * @expectedException \UnexpectedValueException */ public function testDecodeInvalidInput() { Roman::decode('foo'); }
public function combine($form1, $form2, $act2) { // Ex.: _k + miaq > _gmiaq return substr($form1, 0, strlen($form1) - 1) . Roman::latinVoicedOfUnvoicedStopConsonant($form1[strlen($form1) - 1]) . $form2; }
public function combine($form1, $form2, $act2) { // Ex.: _k + miut > _ngmiut return substr($form1, 0, strlen($form1) - 1) . Orthography::latinICIOrthography(Roman::latinNasalOfUnvoicedStopConsonant($form1[strlen($form1) - 1])) . $form2; }