@param $urlSegment
@param $pathSegment

@return bool
340664
protected function segmentMatches($urlSegment, $pathSegment)
    {
        $result = false;
        $realUrlSegment = $urlSegment;

        foreach ($this->getUrlSegmentVoters() as $urlSegmentVoter) {
            $urlSegmentVoter->setUrlSegment($urlSegmentVoter->transformSegment($urlSegment));
            $urlSegmentVoter->setPathSegment($pathSegment);

            if ($urlSegmentVoter->vote() === VoteResult::NO) {
                $result = false;
            }

            if ($urlSegmentVoter->vote() === VoteResult::YES) {
                $result = true;
                $realUrlSegment = $urlSegmentVoter->transformSegment($urlSegment);
            }
        }

        return $result ? $realUrlSegment : false;
    }
1296893
public function isSegment($slugs, $segments = 1, $active = NULL)
	{
		$this->hasSegment($slugs, $segments, $active);
	}
1301110
public function hideSubtree($pathString)
    {
        try {
            return $this->innerGateway->hideSubtree($pathString);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1082425
public function parse(&$segments)
    {
        $query = array();
        $path = implode('/', $segments);
        if ($path == 'new') {
            array_pop($segments);
            $query = array_merge(parent::parse($segments), array('new' => true));
        } else {
            return parent::parse($segments);
        }

        return $query;
    }
866783
protected function walkMenuTree(Menu $m, array $pathSegments) {

		if(!count($pathSegments)) {
			return;
		}

		// return when matching entry in current menu

		if(($e = $m->getSelectedEntry())) {
			return $e;
		}

        // get current page id to evaluate active menu entry
		
		$pathToMatch = urldecode(implode('/', $pathSegments));
		
		foreach($m->getEntries() as $e) {

			$path = urldecode($e->getPath());

            // check for a possible "root" (i.e. "/") path

            if(!$path && !$pathToMatch) {
                $e->getMenu()->setSelectedEntry($e);
                return $e;
            }

            // path segment doesn't match menu entry - finish walk

			if($path && 0 === strpos($pathToMatch, $path)) {

				$pathSegments = explode('/', trim(substr($pathToMatch, strlen($path)), '/'));
				
				$e->getMenu()->setSelectedEntry($e);
				$sm = $e->getSubMenu();

				// walk  into submenu

				if($sm) {
					$this->walkMenuTree($sm, $pathSegments);
				}
			}
		}
	}
922109
protected function checkUrlNode(\DOMNode $urlNode)
    {
        $hasLocalization = (null != $urlNode->attributes->getNamedItem('localization'))
            || (false !== strpos($urlNode->nodeValue, '{localization}'));

        $hasLanguage = (null != $urlNode->attributes->getNamedItem('language'))
            || (false !== strpos($urlNode->nodeValue, '{language}'))
            || $hasLocalization;

        $hasSegment = (0 == count($this->webspace->getSegments()))
            || (null != $urlNode->attributes->getNamedItem('segment'))
            || (false !== strpos($urlNode->nodeValue, '{segment}'));

        $hasRedirect = (null != $urlNode->attributes->getNamedItem('redirect'));

        return ($hasLanguage && $hasSegment) || $hasRedirect;
    }
268251
public static function removeUrlSegment($url, $segment, $replacement = '/')
    {
        $preparedSegment = trim($segment, '/');
        if (empty($preparedSegment)) {
            return $url;
        }
        preg_match('/^([^?]+?)(\?.+?)?$/', $url, $matches); // get url and get apart
        return preg_replace(
                '/(?:\/|^)' . $preparedSegment . '(?:\/|$)/i',
                $replacement,
                (isset($matches[1]) ? $matches[1] : '')
            ) . (isset($matches[2]) ? $matches[2] : '');
    }
349437
protected function wrapSegments($segments)
    {
        return collect($segments)->map(function ($segment, $key) use ($segments) {
            return $key == 0 && count($segments) > 1
                            ? $this->wrapTable($segment)
                            : $this->wrapValue($segment);
        })->implode('.');
    }
454760
public static function buildUrl($parts)
    {
        $url = '';

        if (isset($parts['scheme'])) {
            $url .= $parts['scheme'].'://';
        }

        if (isset($parts['user'])) {
            if (isset($parts['pass'])) {
                $url .= $parts['user'].':'.$parts['pass'].'@';
            } else {
                $url .= $parts['user'].'@';
            }
        }

        if (isset($parts['host'])) {
            $url .= $parts['host'];
        }

        if (isset($parts['port'])) {
            $url .= ':'.$parts['port'];
        }

        if (isset($parts['path'])) {
            $url .= $parts['path'];
        }

        if (isset($parts['query'])) {
            $url .= '?'.$parts['query'];
        }

        if (isset($parts['fragment'])) {
            $url .= '#'.$parts['fragment'];
        }

        return $url;
    }
454950
protected function matchLanguageCode(array $pathElementData, $pathElement)
    {
        foreach ($this->sortTranslationsByPrioritizedLanguages($pathElementData['translations']) as $translationData) {
            if (strtolower($pathElement) === strtolower($translationData['text'])) {
                return $translationData['lang'];
            }
        }

        return false;
    }
555799
public static String urlFrom( String baseUrl,
                                  String... pathSegments ) {
        StringBuilder urlBuilder = new StringBuilder(baseUrl);
        if (urlBuilder.charAt(urlBuilder.length() - 1) == '/') {
            urlBuilder.deleteCharAt(urlBuilder.length() - 1);
        }
        for (String pathSegment : pathSegments) {
            if (pathSegment.equalsIgnoreCase("..")) {
                urlBuilder.delete(urlBuilder.lastIndexOf("/"), urlBuilder.length());
            } else {
                if (!pathSegment.startsWith("/")) {
                    urlBuilder.append("/");
                }
                urlBuilder.append(pathSegment);
            }
        }
        return urlBuilder.toString();
    }
152781
private static function checkParsedUrl(array $parsed)
    {
        $scheme   =& $parsed['scheme'];
        $user     =& $parsed['user'];
        $pass     =& $parsed['pass'];
        $host     =& $parsed['host'];
        $port     =& $parsed['port'];
        $path     =& $parsed['path'];
        $path     = '/'.ltrim($path, '/'); // If / is missing for path.
        $query    =& $parsed['query'];
        $fragment =& $parsed['fragment'];

        return compact(
            'scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'
        );
    }
131403
function processURLSegments(parentNode, segments) {
		segments.forEach(function(segment) {
			if (segment.urlStr){
				var link = document.createElement("a"); //$NON-NLS-0$
		        link.href = segment.urlStr;
		        link.appendChild(document.createTextNode(segment.segmentStr));
		        link.dir = bidiUtils.getTextDirection(segment.segmentStr);
				parentNode.appendChild(link);
			} else {
				var plainText = document.createElement("span"); //$NON-NLS-0$
				plainText.textContent = segment.segmentStr;
				plainText.dir = bidiUtils.getTextDirection(segment.segmentStr);
				parentNode.appendChild(plainText);
			}
		});
	}
201496
public static function appendSegment($uri, string $segment)
    {
        $uri = self::filterUri($uri);

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->append($segment));
    }
595381
public function segment($segment)
    {
        $segments = $this->segments;

        return isset($segments[$segment - 1]) ? $segments[$segment - 1] : false;
    }
491102
public void setUserDomainSegment(com.google.api.ads.admanager.axis.v201808.UserDomainTargeting userDomainSegment) {
        this.userDomainSegment = userDomainSegment;
    }
299358
public void setBrowserSegment(com.google.api.ads.admanager.axis.v201902.BrowserTargeting browserSegment) {
        this.browserSegment = browserSegment;
    }