Create a puzzle.

@param array   $words List of words.
@param integer $size  Grid size.
@param string  $lang  Language.
@return Puzzle
421420
public static function create(array $words, $size = 15, $lang = 'en')
    {
        $alphabet = ($lang == 'fi') ? new Alphabet\Finnish : null;
        $generator = new Generator($words, $size, $alphabet);
        return $generator->generate();
    }
1083606
public function setSize(int $size)
    {
        $sizes = [
            1,
            2,
            3,
            4,
            5,
            6
        ];

        if (! in_array((int) $size, $sizes)) {
            Throw new ElementException('Size "' . $size . '" is not an allowed size for heading html elements');
        }

        $this->element = 'h' . $size;

        return $this;
    }
747809
public function set($lang) {
    if (!array_key_exists($lang, $this->getList())) {
      throw new LanguageNotPresentException;
    }
    $this->locator->set($lang);
    return $lang;
  }
728262
public static function configure($lang, $directory)
    {
        if (static::$instance === null) {
            static::$instance = new self($lang, $directory);
        }

        return static::$instance;
    }
311488
public function tl(string $key, array $args = [], $lang = '')
    {
        return $this->translate($key, $args, $lang);
    }
1044921
public function alias($lang, $aliases)
    {
        $lang = strtolower($lang);

        if (!is_array($aliases)) {
            $aliases = [$aliases];
        }

        $aliases = array_map('strtolower', $aliases);

        $this->aliases[$lang] = array_unique(
            array_merge(Arr::get($this->aliases, $lang, []), $aliases)
        );

        return $this;
    }
1165050
public function build($length = null, $charset = null)
    {
        if ($length !== null) {
            $this->length = $length;
        }
        if ($charset !== null) {
            $this->charset = $charset;
        }

        $phrase = '';
        $chars = str_split($this->charset);

        for ($i = 0; $i < $this->length; $i++) {
            $phrase .= $chars[array_rand($chars)];
        }

        return $phrase;
    }
512093
protected function _addLanguage( MW_Container_Content_Interface $contentItem, $langid, array $ids )
	{
		$manager = MShop_Product_Manager_Factory::createManager( $this->_getContext() );
		$search = $manager->createSearch();

		if( !empty( $ids ) ) {
			$search->setConditions( $search->compare( '==', 'product.id', $ids ) );
		}

		$sort = array( $search->sort( '+', 'product.code' ) );
		$search->setSortations( $sort );

		$start = 0;

		do
		{
			$result = $manager->searchItems( $search, array('text') );

			foreach( $result as $item ) {
				$this->_addItem( $contentItem, $item, $langid );
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );
	}
250779
private function buildSize(string $size, array $definition, array $sizes): void
    {
        foreach ($definition as $columnDefinition) {
            $column = $this->buildColumn($columnDefinition, $size, $sizes);

            $this->grid->addColumn($column, $size);
        }
    }
512514
public static function factory(string $role, string $text): Word
    {
        $instance = new static();
        $instance->role = $role;
        $instance->text = $text;

        return $instance;
    }
77225
public function well($text, $size = null, $options = [])
    {
        $options = ['class' => 'well'];

        if (!empty($size)) {
            switch ($size) {
                case 'lg':
                case 'large':
                    $options = parent::addClass($options, 'well-lg');
                    break;
                case 'sm':
                case 'small':
                    $options = parent::addClass($options, 'well-sm');
                    break;
            }
        }
        return parent::tag('div', $text, $options);
    }
136573
public function setFontSize(int $size): PdfInterface
    {
        $this->fontSize = (int) $size;
        $this->mpdf->SetDefaultFontSize($this->fontSize);

        return $this;
    }
869256
public static function setLanguage($lang)
    {
        Application::$instance->i18n->setLanguage($lang);
        \Config::set('i18n.language', $lang);
    }
579567
public static function create($map = array(), $formats = array(), $langs = array(), $charsets = array())
    {
        return new Negotiator($map, $formats, $langs, $charsets);
    }
365993
public static function change($lang)
    {
        exception_if(!in_array($lang, self::$supported), LanguageNotSupportedException::class, $lang);

        self::$lang = $lang;
        self::$words = [];

        self::load();

        return true;
    }
1146854
public function vote($language, $index = 1)
    {
        if (in_array($language, $this->detectedLanguages)) {
            if (!isset($this->votes[$language])) {
                $this->votes[$language] = 0;
            }

            $this->votes[$language] += $index;
        }

        return $this;
    }
1348882
public static function generate($size, $difficulty, $seed = null)
    {
        list($task,) = self::generateWithSolution($size, $difficulty, $seed);
        return $task;
    }