@param Queries\ISegment[] $segments

@return Queries\ISegment[]
1769
protected function processSegments(array $segments)
    {
        $this->segments = [];

        foreach ($segments as $segment) {
            $this->segments[] = $segment->traverse($this);
        }

        return $this->segments;
    }
330406
public static function getDoneFlags(array $plugins, Segment $segment)
    {
        $doneFlags = array();
        $doneAllPlugins = self::getDoneFlagArchiveContainsAllPlugins($segment);
        $doneFlags[$doneAllPlugins] = $doneAllPlugins;

        $plugins = array_unique($plugins);
        foreach ($plugins as $plugin) {
            $doneOnePlugin = self::getDoneFlagArchiveContainsOnePlugin($segment, $plugin);
            $doneFlags[$plugin] = $doneOnePlugin;
        }
        return $doneFlags;
    }
704124
protected function getTarget($target, array $segments)
    {
        foreach ($segments as $segment) {
            if (!$target) {
                return;
            }

            $target = $target->{$segment};
        }

        return $target;
    }
142520
private function getTableName($segments)
    {
        $tableName = [];

        foreach ($segments as $segment) {
            if ($this->isConnectingWord($segment)) {
                break;
            }

            $tableName[] = $segment;
        }

        return implode('_', array_reverse($tableName));
    }
491438
protected function _setRequest($segments = array()){
		$segments = $this->_validateRequest($segments);
		if (count($segments) == 0){
			return $this->uri->_reindex_segments();
		}

		$this->setClass($segments[0]);

		if (isset($segments[1]))
		{
			// A standard method request
			$this->method = $segments[1];
		}
		else
		{
			// This lets the "routed" segment array identify that the default
			// index method is being used.
			$segments[1] = 'index';
		}

		// Update our "routed" segment array to contain the segments.
		// Note: If there is no custom routing, this array will be
		// identical to $this->uri->segments
		$this->uri->rsegments = $segments;
	}
974930
private function _mergeSegments($segments)
    {
        $newName = $this->_newSegmentName();

        /**
 * Zend_Search_Lucene_Index_SegmentMerger 
*/
        include_once 'Zend/Search/Lucene/Index/SegmentMerger.php';
        $merger = new Zend_Search_Lucene_Index_SegmentMerger(
            $this->_directory,
            $newName
        );
        foreach ($segments as $segmentInfo) {
            $merger->addSource($segmentInfo);
            $this->_segmentsToDelete[$segmentInfo->getName()] = $segmentInfo->getName();
        }

        $newSegment = $merger->merge();
        if ($newSegment !== null) {
            $this->_newSegments[$newSegment->getName()] = $newSegment;
        }

        $this->commit();
    }
197774
public function segments()
    {
        $segments = explode('/', $this->decodedPath());

        return array_values(array_filter($segments, function ($value) {
            return $value !== '';
        }));
    }
1212675
protected function createSegments(array $tokens) : array
    {
        // Stack of opened tags.
        $active = new TagStack();

        return array_reduce($tokens, function (array $segments, $token) use ($active) {
            if ($token instanceof TagToken) {
                /** @var TagToken $token */
                if ($token->isOpening()) {
                    // If tag token is opening, add tag to the stack.
                    $active->push(Tag::createFromToken($token));
                } else {
                    // If tag token is closing, find matching tag in the stack.
                    $tagName = $token->getTagName();
                    $isFound = $active->removeLast($tagName);
                    if (!$isFound) {
                        // If not found, return tag token as a text.
                        $text = $token->getRawText();
                        $tags = $active->asArray();
                        $segments[] = new TextSegment($text, $tags);
                    }
                }
            } else {
                // Return text segment with currently active tags.
                /** @var TextToken $token */
                $text = $token->getRawText();
                $tags = $active->asArray();
                $segments[] = new TextSegment($text, $tags);
            }

            return $segments;
        }, []);
    }
1095682
public function parse(&$segments)
    {
        $path = implode('/', $segments);
        $vars = array();

        $matches = array();
        if (preg_match('/(\d+)-([^\/]+)/', $path, $matches)) {
            $vars['alias'] = $matches[2];
            $path = str_replace($matches[0], $matches[1], $path);
            $segments = array_filter(explode('/', $path));
        }

        $path = implode('/', $segments);

        $matches = array();

        if (preg_match('/@(\w+)/', $path, $matches)) {
            $vars['oid'] = $matches[1];
            if (isset($matches[2])) {
                $vars['view'] = $matches[2];
            }
            $path = ltrim(str_replace($matches[0], '', $path), '/');
            $segments = array_filter(explode('/', $path));
        }

        $vars = array_merge($vars, parent::parse($segments));

        if (isset($vars['id']) && current($segments)) {
            $vars['alias'] = array_shift($segments);
        }

        return $vars;
    }
1277480
public function getSegments($all = false)
    {
        if ($all) {
            return $this->segments;
        }
        $segments = [];
        foreach ($this->segments as $segment) {
            if ($segment->isEnabled()) {
                $segments[] = $segment;
            }
        }
        return $segments;
    }
454013
public function getData($segments){
		$data=new \stdClass();
		$this->json=new \stdClass();
		$this->getDataJson($segments, $this->json);

		$data->error=$this->error;
		$data->json=$this->json;
		$this->json->error=$this->error;
		return $data;
		}
340680
public function delocalizeSegments(array &$segments)
    {
        if (count($segments) > 0) {
            $locale = $segments[0];
            if ($this->localeHelper->isValidLocale($locale)) {
                array_shift($segments);
            }
        }
    }
708841
protected function joinSegment(Builder $query, $segment, EloquentModel $parent)
    {
        $relation = $parent->{$segment}();
        $related  = $relation->getRelated();
        $table    = $related->getTable();

        // If the table has been already joined let's skip it. Otherwise we will left join
        // it in order to allow using some query methods on mapped columns. Polymorphic
        // relations require also additional constraints, so let's handle it as well.
        if (!$this->alreadyJoined($query, $table)) {
            list($fk, $pk) = $this->getJoinKeys($relation);

            $query->leftJoin($table, function ($join) use ($fk, $pk, $relation, $parent, $related) {
                $join->on($fk, '=', $pk);

                if ($relation instanceof MorphOne || $relation instanceof MorphTo) {
                    $morphClass = ($relation instanceof MorphOne)
                        ? $parent->getMorphClass()
                        : $related->getMorphClass();

                    $join->where($relation->getQualifiedMorphType(), '=', $morphClass);
                }
            });
        }

        return [$table, $related];
    }
910173
public static function segmentIsOptional($segment)
        {
            $name = mb_substr($segment, 1);

            $optMarkerPos = mb_strpos($name, '?');

            if ($optMarkerPos === false) return false;

            $regexMarkerPos = mb_strpos($name, '|');

            if ($regexMarkerPos === false) return true;

            if ($optMarkerPos !== false && $regexMarkerPos !== false) return $optMarkerPos < $regexMarkerPos;

            return false;
        }
711165
public function getSegment($segment = 1)
    {
        $segment = (!is_null($segment)) ? $segment : 1;
        $uri = $this->router->getCurrentUri();
        $urlArray = array_filter(explode('/', $uri));
        $indexCount = array_search(Router::$indexPage, $urlArray);

        if ($indexCount == true) {
            $num = $indexCount + $segment;

            return isset($urlArray[$num]) ? $urlArray[$num] : null;
        }

        return isset($urlArray[$segment]) ? $urlArray[$segment] : null;
    }
240551
public static function segmentArray() : Array
    {
        $segmentEx = Arrays\RemoveElement::element(explode('/', self::_cleanPath()), '');

        return $segmentEx;
    }
554908
public function setSegments($segments)
    {
        $this->segments = is_array($segments) ? implode('/', $segments) : $segments;

        return $this;
    }