Assign word to array
@param string $word
@param int $value
@return string
11646
public function addWord($word, $value = 1)
    {
        if (isset($this->wordsArray[$word])) {
            $this->wordsArray[$word] += $value;
        } else {
            $this->wordsArray[$word] = $value;
        }
    }
344561
private function prepareRow($value)
    {
        if (is_array($value) and count($value) === 1) {
            $value = array_shift($value);
        }

        return $value;
    }
1255740
protected function createArray(array &$value)
    {
        $size = count($value);
        if ($size > 0 && array_keys($value) !== range(0, $size - 1)) {
            return $this->createObjectFromArray($value);
        }

        $instance = new Value\ArrayValue;
        $this->register($value, $instance);

        foreach ($value as $key => &$subValue) {
            $instance->set($key, $this->createValue($subValue));
        }

        return $instance;
    }
1338159
protected function getWordIndex($word, $offset)
    {
        $index = mb_strpos($this->title, $word, $offset, $this->encoding);
        return $this->correctIndexOffset($index);
    }
106586
public static function stringToArray($value)
    {
        $value = strtoupper($value);
        $newValue = [];
        foreach (explode(';', $value) as $part) {
            // Skipping empty parts.
            if (empty($part)) {
                continue;
            }
            list($partName, $partValue) = explode('=', $part);

            // The value itself had multiple values..
            if (false !== strpos($partValue, ',')) {
                $partValue = explode(',', $partValue);
            }
            $newValue[$partName] = $partValue;
        }

        return $newValue;
    }
1222985
public function toArray($value)
    {
        if (empty($value)) {
            return null;
        }

        $output = [];
        foreach ($value as $val) {
            $output[] = $this->field->toArray($val);
        }

        return $output;
    }
922082
public function process($value, $numwords = false)
    {
        if ($numwords || preg_match('#^[^0-9]+$#', $value)) {
            return mb_convert_case((string)$value, MB_CASE_TITLE, $this->core->getCharset());
        } else {
            $bits = explode(' ', (string)$value);
            $out  = '';
            foreach ($bits as $k => $v){
                if (preg_match('#^[^0-9]+$#', $v)) {
                    $out .= ' ' . mb_convert_case($v, MB_CASE_TITLE, $this->core->getCharset());
                } else {
                    $out .= ' ' . $v;
                }
            }

            return substr($out, 1);
        }
    }
27807
protected function ucWords($word)
    {
        $arr = explode('-', $word);
        $list = [];
        foreach ($arr as $vo) {
            $list[] = ucfirst($vo);
        }
        return implode('-', $list);
    }
1000726
private function basicStrength($value): array
    {
        $score = 0;

        if (\strlen($value) > 4) {
            $score++;
        }

        if (\preg_match('/[a-z]/', $value) && \preg_match('/[A-Z]/', $value)) {
            $score++;
        }

        if (\preg_match('/\d+/', $value)) {
            $score++;
        }

        // none word
        if (\preg_match('/\W+/', $value)) {
            $score++;
        }

        return ['score' => $score];
    }
909280
private static function rotate($word){
		$c = $word[0];
		for ($i = 0; $i < 3; $i++)
			$word[$i] = $word[$i+1];
		$word[3] = $c;

		return $word;
	}
158777
public function assign(string $name, $value): object
    {
        $this->data[$name] = $value;
        return $this;
    }
492343
public function _prep_value($value) {
		if (is_array($value)) {
			$value=implode(",", $value);
		}
		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false&&strrpos($value, 'self')===false) {
			$value='"'.$value.'"';
		}
		return $value;
	}
306022
protected function inArray($value)
    {
        if ($this->strict) {
            $isIn = in_array($value, $this->range, true);
        } else {
            $isIn = false;
            foreach ($this->range as $r) {
                $isIn = (strcmp($r, $value) === 0);
                if ($isIn) break;
            }
        }
        return $isIn;
    }
312841
protected function singularize($word)
    {
        $result = strval($word);

        if (in_array(strtolower($result), $this->uncountableWords())) {
            return $result;
        } else {
            foreach ($this->singularRules() as $rule => $replacement) {
                if (preg_match($rule, $result)) {
                    $result = preg_replace($rule, $replacement, $result);
                    break;
                }
            }

            return $result;
        }
    }
720834
public function assign($data, $value = null) {
        if (is_array($data)) {
            $this->data = array_merge($this->data, $data);
        } else if ($data) {
            $this->data [ $data ] = $value;
        }

        return $this;
    }
924328
protected function prefix($value, $prefix)
    {
        if (is_array($value)) {
            return array_map(function ($item) use ($prefix) {
                return $this->prefix($item, $prefix);
            }, $value);
        }

        return $prefix . $value;
    }
144619
private static function dumpArray($value)
	{
		// array
		if ($value && !self::isHash($value)) {
			$output = [];
			foreach ($value as $val) {
				$output[] = self::dump($val);
			}

			return \sprintf('[%s]', \implode(', ', $output));
		}

		// hash
		$output = [];
		foreach ($value as $key => $val) {
			$output[] = \sprintf('%s: %s', self::dump($key), self::dump($val));
		}

		return \sprintf('{ %s }', \implode(', ', $output));
	}