Example #1
0
 static function singleton()
 {
     if (!self::$Instance) {
         self::$Instance = new self();
     }
     return self::$Instance;
 }
 function __construct($name)
 {
     $this->name = $name;
     $this->filter = new IpcaImage();
     $this->filter->load_1Line1Element(ConfPath::keywordsFilter(), 0, 1);
     $this->keywords = KeywordsTable::singleton();
     $this->keywords->loadTable(ConfPath::keywords());
     $this->ipca = Ipca::singleton();
     $this->ipca->load(self::DIMANSION_MAX);
 }
 protected function initLearn()
 {
     if ($this->initialized) {
         return;
     }
     $this->state = new BlockState();
     $this->state->loadMatrix(ConfPath::stateMatrix($this->name));
     $this->state->loadText2id(ConfPath::stateTexts($this->name));
     $this->keywords = KeywordsTable::singleton();
     $this->keywords->loadTable(ConfPath::keywords());
     $this->filter = new IpcaImage();
     $this->filter->load_1Line1Element(ConfPath::keywordsFilter(), 0, 1);
     $this->ipca = Ipca::singleton();
     $this->ipca->load(3);
     $this->initialized = true;
 }
Example #4
0
 function __construct()
 {
     $this->ipca = Ipca::singleton();
     $this->ipca->load();
 }