Example #1
0
 function getTranslations($input)
 {
     $w = new Workflows("psistorm.alfed.leo");
     $leo = new LeoParser();
     $cleanedInput = clean_utf8($input);
     $url = "http://dict.leo.org/" . $this->translationCode . "/?lang=en&searchLoc=0&search=" . urlencode($cleanedInput);
     $str = $w->request($url);
     $options = $leo->get($str);
     if ($options != array()) {
         foreach ($options as $option) {
             $w->result(time(), "{" . $this->translationCode . "}" . $option->translatedWord, $option->translatedWord, $option->originalWord, $option->languageCode . ".png", "yes", $option->originalWord);
         }
     }
     return $w->toxml();
 }
Example #2
0
 function getTranslations($input)
 {
     $w = new Workflows("psistorm.alfed.leo");
     $leo = new LeoParser();
     $cleanedInput = clean_utf8($input);
     $url = "http://dict.leo.org/dictQuery/m-vocab/" . $this->translationCode . "/query.xml?tolerMode=nof&lp=" . $this->translationCode . "&lang=de&rmWords=off&directN=0&rmSearch=on&search=" . urlencode($cleanedInput) . "&searchLoc=0&resultOrder=basic&multiwordShowSingle=on&sectLenMax=16";
     $str = $w->request($url, array(CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 5));
     if (!empty($str)) {
         $options = $leo->get($str);
         if ($options != array()) {
             foreach ($options as $option) {
                 $argument = "{" . $this->translationCode . "}{" . $option->originalWord . "}{" . $option->translatedWord . "}";
                 $w->result(time(), $argument, $option->translatedWord, $option->originalWord, $option->languageCode . ".png", "yes", $option->originalWord);
             }
         }
     } else {
         $w->result(time(), "", "Timeout occurred.", $option->originalWord, "icon.png", "no");
     }
     return $w->toxml();
 }
Example #3
0
 //	echo $sql;
 $data = array();
 while ($ligne = mysql_fetch_array($resultat)) {
     $data[$ligne[1]] = $ligne[0];
     //echo "jour:".$ligne[1].' nb de billets= '.$ligne[0].'<br>';
 }
 $sql = 'SELECT forme_principale FROM concepts WHERE id=' . $id_concept;
 $resultat = mysql_query($sql);
 //	echo $sql;
 while ($ligne = mysql_fetch_array($resultat)) {
     $label = $ligne['forme_principale'];
 }
 //	echo 'dont la forme principale est'.$label.$id_concept;
 $label = str_replace('é', 'e', $label);
 $label = str_replace('%E9', 'e', $label);
 $label = clean_text(clean_utf8($label));
 //	echo $label;
 $data_propre = array();
 $xlab_an = array();
 echo '***************<br>';
 echo $periodes['from'];
 echo '<br>***************<br>';
 for ($i = $periodes['from']; $i <= $periodes['to']; $i += 1) {
     $xlab_an[] = $i;
     if (array_key_exists($i, $data)) {
         $data_propre[$i] = $data[$i] + $j / 45;
     } else {
         $data_propre[$i] = 0 + $j / 45;
     }
 }
 //print_r($data_propre);
Example #4
0
 function clean($str)
 {
     return clean_utf8($str);
 }