Commit 131d8f89 authored by Sylvain Hatier's avatar Sylvain Hatier Committed by Arnaud Bey
Browse files

Trim import lexique

parent 9cd7d5c9
......@@ -161,7 +161,7 @@ class ImportManager
#mb_eregi_replace ?
$cleanWordValue = str_replace($specs["rewriteFrom"], $specs["rewriteTo"], $wordValue);
// $cleanWordValue = preg_replace($specs["rewriteFrom"], $specs["rewriteTo"], $wordValue);
$cleanWordValue = trim($cleanWordValue);
$string2print="ROOT = ".$rootValue." / CLEAN = ".$cleanWordValue;
//$cleanWordValue = preg_replace("/\P{L}/", "", $cleanWordValue);#bug pour le russe
$cleanWordValue = mb_eregi_replace("/\P{L}/", "", $cleanWordValue);#fonctionne pour le russe
......@@ -181,7 +181,7 @@ class ImportManager
$features = [];
foreach ($labelsNValues as $labelNValue) {
$featureStringTab = explode("=", $labelNValue);
$features[] = $this->fm->findOrCreate($language, $featureStringTab[0], $featureStringTab[1], $featuresToFlush);
$features[] = $this->fm->findOrCreate($language, trim($featureStringTab[0]), trim($featureStringTab[1]), $featuresToFlush);
}
// WORD
......@@ -201,7 +201,7 @@ class ImportManager
//Gestion des $bigram
if ($previousLetter != "") {
$bigramString = $previousLetter.$wordLetter;
$bigrams[$bigramString] = !array_key_exists($bigramString, $bigrams) ? 1 : $bigrams[$bigramString] + 1;
$bigrams[trim($bigramString)] = !array_key_exists($bigramString, $bigrams) ? 1 : $bigrams[$bigramString] + 1;
}
$previousLetter = $wordLetter;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment