X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d3604b8594ce1c2ec01bac675fc35b49ab8fc7df..ff36d7d8df16d1a1d94656bda7b8b7d4b9422a3a:/lib/TokenList.php diff --git a/lib/TokenList.php b/lib/TokenList.php index 84dc98d0..fce5f940 100644 --- a/lib/TokenList.php +++ b/lib/TokenList.php @@ -55,6 +55,18 @@ class TokenList return isset($this->aTokens[$sWord]); } + /** + * Check if there are partial or full tokens for the given word. + * + * @param string $sWord Token word to look for. + * + * @return bool True if there is one or more token for the token word. + */ + public function containsAny($sWord) + { + return isset($this->aTokens[$sWord]) || isset($this->aTokens[' '.$sWord]); + } + /** * Get the list of tokens for the given token word. *