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 e1819c1c authored by Arnaud Bey's avatar Arnaud Bey
Browse files

add index on clean value

parent 745c6643
...@@ -6,9 +6,13 @@ use Doctrine\Common\Collections\ArrayCollection; ...@@ -6,9 +6,13 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use JsonSerializable; use JsonSerializable;
use Doctrine\ORM\Mapping\Index;
/** /**
* @ORM\Table(name="lexicon_word") * @ORM\Table(name="lexicon_word", indexes={
* @Index(columns={"clean_value"}, name="cleanValue"),
* @Index(name="language", columns={"language_id"}),
* }))
* @ORM\Entity(repositoryClass="LexiconBundle\Repository\WordRepository") * @ORM\Entity(repositoryClass="LexiconBundle\Repository\WordRepository")
*/ */
class Word implements JsonSerializable class Word implements JsonSerializable
......
...@@ -48,6 +48,7 @@ class GridManager ...@@ -48,6 +48,7 @@ class GridManager
public function generate(Language $language, $debug = false, $minBigram = null) public function generate(Language $language, $debug = false, $minBigram = null)
{ {
$grid = $this->newGrid($language, 4); $grid = $this->newGrid($language, 4);
$minBigram = ($minBigram == null) ? $language->getMinBigram() : $minBigram; $minBigram = ($minBigram == null) ? $language->getMinBigram() : $minBigram;
$letters = $this->lottery($language, 4, $debug, $minBigram); $letters = $this->lottery($language, 4, $debug, $minBigram);
...@@ -350,7 +351,7 @@ class GridManager ...@@ -350,7 +351,7 @@ class GridManager
public function lottery(Language $language, $side, $debug = false, $minBigram = null) public function lottery(Language $language, $side, $debug = false, $minBigram = null)
{ {
$minBigram = ($minBigram == null) ? $language->getMinBigram() : $minBigram; $minBigram = ($minBigram == null) ? $language->getMinBigram() : $minBigram;
$fileBigrams = $language->getDirectory().DIRECTORY_SEPARATOR."bigrams.txt"; $fileBigrams = $language->getDirectory().DIRECTORY_SEPARATOR."bigrams.txt";
// On crée un tableau de bigrammes // On crée un tableau de bigrammes
// où chaque bigramme apparait autant de fois que son poids // où chaque bigramme apparait autant de fois que son poids
......
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