]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/TokenList.php
New readme file on how to build the documentation
[nominatim.git] / lib / TokenList.php
index 84dc98d0584fee10558f3271582bcfe4462fd328..fce5f940b84513a6bc1850cbbbdb5e9fa043682c 100644 (file)
@@ -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.
      *