Gets an index from a raw string.

@var CrestApps\CodeGenerator\Models\Index
770113
public static function fromString($rawIndex)
    {
        // The expected string format is this
        //name:some_name;columns:full_name|last_name;type:index,

        $parts = explode(';', $rawIndex);

        foreach ($parts as $part) {
            if (!str_contains($part, ':')) {
                continue;
            }

            list($key, $value) = explode(':', $part);
            $collection[$key] = $value;
        }

        return self::get($collection);
    }
30114
public static function indexOf($string, $needle, $strict = true, $offset = 0) {
        if ($strict) {
            return mb_strpos($string, $needle, $offset);
        }

        return mb_stripos($string, $needle, $offset);
    }
960264
function raw($arg) {
		return $this->fw->recursive($arg,
			function($val) {
				return is_string($val)?$this->fw->decode($val):$val;
			}
		);
	}
1079628
private String getIndex() {

        try {
            return parseMandatoryStringValue(XML_ELEMENT_INDEX);
        } catch (final Exception e) {
            LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_SPECIFIED_0), e);
            return null;
        }
    }
325738
public function charAt( $index ) {
		if ( $index < 0 || $index >= $this->length() ) {
			throw new GStringIndexOutOfBoundsException( $index );
		}

		return $this->value[ $index ];
	}
989743
public function get($string)
    {
        $lowercase = strtolower($string);

        if (!parent::has($lowercase))
        {
            if (isset($this->_aliases[$lowercase])) {
                $key = $this->_aliases[$lowercase];
            }
            else if(!JFactory::getLanguage()->hasKey($string))
            {
                if (substr($string, 0, strlen($this->getPrefix())) === $this->getPrefix()) {
                    $key = $string;
                } else {
                    //Gets a key from the catalogue and prefixes it
                    $key = $this->getPrefix().$this->generateKey($string);
                }
            }
            else $key = $string;

            $this->set($lowercase, JFactory::getLanguage()->_($key));
        }

        return parent::get($lowercase);
    }
1230478
protected function getIndex($property, $index = null, $type = null) {
		//verify valid property
		if (!$this->wrappedArg->offsetExists($property))
			throw new \InvalidArgumentException("Unknown property '$property'");
	
		if (is_null($index))
			return $this->castParameter($this->wrappedArg->offsetGet($property), $type);
	
		//check if the value is null
		$value = $this->wrappedArg->offsetGet($property);
		if (is_null($value))
			throw new \InvalidArgumentException("Trying to obtain value from NULL property '$property'");
	
		//check value type
		if (is_array($value)) {
			//search for string index
			if (array_key_exists($index, $value))
				return $this->castParameter($value[$index], $type);
			//try numeric index instead
			elseif (is_numeric($index) && array_key_exists(intval($index), $value))
				return $this->castParameter($value[intval($index)], $type);
	
			throw new \InvalidArgumentException("Index '$index' does not exists in property '$property'");
		}
		//try to convert value to string
		elseif (($value = $this->toString($value)) !== false) {
			//check string length against index
			if ($index < strlen($value))
				return $this->castParameter($value[$index], $type);
	
			throw new \OutOfBoundsException("Index '$index' out of bounds for property '$property'");
		}
			
		throw new \InvalidArgumentException("Cannot obtain index '$index' from a non array/string property '$property'");
	}
688176
public function get(?string $index, string $text, ?array $params = null)
    {
        if (App::$Request->getLanguage() !== App::$Properties->get('baseLanguage')) {
            if ($index && !Arr::in($index, $this->indexes)) {
                $this->cached = Arr::merge($this->cached, $this->load($index));
                $this->indexes[] = $index;
            }

            if ($this->cached && Any::isStr($text) && isset($this->cached[$text])) {
                $text = $this->cached[$text];
            }
        }

        if (Any::isArray($params) && count($params) > 0) {
            foreach ($params as $var => $value) {
                $text = Str::replace('%' . $var . '%', $value, $text);
            }
        }
        return $text;
    }
1184720
public function getIndexName(): string
    {
        $name = trim($this->indexNameStrategy->get());
        if ($name === '') {
            throw new Exception('Index name can not be null');
        }

        return $name;
    }
988576
public function loadIndexedRow()
    {
        if ($this->stmt === null) {
            return null;
        }

        return $this->stmt->fetch(\PDO::FETCH_NUM);
    }
886282
public function getCharAt(int $index): string
    {
        if (!isset($this->charsSet[$index])) {
            throw DictionaryException::indexOutOfBounds();
        }

        return $this->charsSet[$index];
    }
931111
function(string) {
		var index = this.stringLookupQuick[string];
		// If missing, allocate now
		if (index === undefined) {
			index = this.stringLookup.length;
			this.stringLookup.push( string );
			this.stringLookupQuick[string]= index;
		}
		return index;
	}
954543
public function read(string $index)
    {
        $this->withIndexFilter($index);

        $builder = $this->createIndexModelBuilder();
        $data    = $this->fetchResource($builder, $builder->getModelClass());

        return $data;
    }
866573
function getIndex($a) {
		/** @var int $result */
		/** @var int $n100 */
		$n100 = $a % 100;
		/** @var int $n100 */
		$n10 = $a % 10;
		if (($n100 > 10) && ($n100 < 20)) {
			$result = self::NOUN_FORM_5;
		}
		elseif ($n10 === 1) {
			$result = self::NOUN_FORM_1;
		}
		elseif (($n10 >= 2) && ($n10 <= 4)) {
			$result = self::NOUN_FORM_2;
		}
		else {
			$result = self::NOUN_FORM_5;
		}
		return $result;
	}
503999
protected function getIndex()
	{
		if (!$this->index) {
			$path = rtrim(Config::get('search.connections.zend.path'), '/') . '/' . $this->name;
			
			try {
				$this->index = \ZendSearch\Lucene\Lucene::open($path);
			} catch (\ZendSearch\Exception\ExceptionInterface $e) {
				$this->index = \ZendSearch\Lucene\Lucene::create($path);
			} catch (\ErrorException $e) {
				if (!file_exists($path)) {
					throw new \Exception(
						"'path' directory does not exist for the 'zend' search driver: '"
						. rtrim(Config::get('search.connections.zend.path'), '/')
						. "'"
					);
				}
				throw $e;
			}
			
			\ZendSearch\Lucene\Analysis\Analyzer\Analyzer::setDefault(
				new \ZendSearch\Lucene\Analysis\Analyzer\Common\Utf8Num\CaseInsensitive()
			);
		}
		
		return $this->index;
	}
209842
public function getBy($index, $nested = false) {
		$out = array();
		foreach ($this->getArrayCopy() as $model)
			if ($model->exists($index)) {
				$val = $model->get($index, true);
				if (!empty($val))
					if($nested) $out[(string) $val][] = $model;
					else        $out[(string) $val] = $model;
			}
		return $out;
	}
262759
public function offsetGet($index)
    {
        foreach ((array)$this as $i => $element) {
            $i = (string)$i;
            if (is_string($element)) {
                continue;
            }
            if ($element->getElement()->getValue() == $index) {
                return $element;
            }
        }
        return parent::offsetGet($index);
    }