Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

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

Ajout propriété minBigram

parent f7c0bb50
......@@ -40,7 +40,7 @@
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=",
"requires": {
"sprintf-js": "~1.0.2"
}
......@@ -151,7 +151,7 @@
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -264,7 +264,7 @@
"concat-stream": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
......@@ -366,7 +366,7 @@
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
"integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
"integrity": "sha1-RoTXF3mtOa8Xfj8AeZb3xnyFJhg=",
"optional": true,
"requires": {
"prr": "~1.0.1"
......@@ -506,7 +506,7 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
},
"gaze": {
"version": "1.1.3",
......@@ -835,7 +835,7 @@
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
"integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
......@@ -876,7 +876,7 @@
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
"integrity": "sha1-76ouqdqg16suoTqXsritUf776L4="
},
"is-builtin-module": {
"version": "1.0.0",
......@@ -1114,7 +1114,7 @@
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -1297,7 +1297,7 @@
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
"integrity": "sha1-o31zL0JxtKsa0HDTVQjoKQeI/6o="
},
"promise": {
"version": "7.3.1",
......@@ -1462,7 +1462,7 @@
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
},
"safe-json-parse": {
"version": "1.0.1",
......@@ -1473,7 +1473,7 @@
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
},
"screenfull": {
"version": "3.3.2",
......@@ -1521,7 +1521,7 @@
"spdx-expression-parse": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
"integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=",
"requires": {
"spdx-exceptions": "^2.1.0",
"spdx-license-ids": "^3.0.0"
......@@ -1736,7 +1736,7 @@
"websocket-extensions": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
"integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=",
"dev": true
},
"which": {
......
......@@ -26,6 +26,12 @@ class Language
*/
private $value;
/**
* @var int
*
* @ORM\Column(name="minBigram", type="integer")
*/
private $minBigram = 1;
/**
......@@ -267,7 +273,7 @@ class Language
return $this;
}
/**
* Add comboPoint.
*
......@@ -293,4 +299,28 @@ class Language
{
return $this->comboPoints->removeElement($comboPoint);
}
/**
* Set minBigram.
*
* @param int $minBigram
*
* @return Language
*/
public function setMinBigram($minBigram)
{
$this->minBigram = $minBigram;
return $this;
}
/**
* Get minBigram.
*
* @return int
*/
public function getMinBigram()
{
return $this->minBigram;
}
}
......@@ -359,14 +359,19 @@ class GridManager
foreach ($lines as $line) {
$tab = explode("\t", $line);
$string = $tab[0];
$freqBigramBi = $tab[1];
$poids = $tab[3];
$bigramLetters = preg_split('//u', $string, null, PREG_SPLIT_NO_EMPTY);
foreach ($bigramLetters as $bigramLetter) {
$lettersFromBigrams[$bigramLetter] = 1;
}
$minBigram = $language->getMinBigram();
//si Freq du bigram et son inverse est < à min défini par user alors on le prend pas en compte
if ($freqBigramBi > $minBigram) {
$bigramLetters = preg_split('//u', $string, null, PREG_SPLIT_NO_EMPTY);
foreach ($bigramLetters as $bigramLetter) {
$lettersFromBigrams[$bigramLetter] = 1;
}
for ($j = 0; $j < $poids; $j++) {
$bigrams[] = $string;
for ($j = 0; $j < $poids; $j++) {
$bigrams[] = $string;
}
}
}
$countsBigram = array_count_values($bigrams);
......
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