/**
  * Attempts to match given user agent string to a device from the database by calculating their Levenshtein Distance (LD)
  * @param int $tolerance Tolerance, how much difference is allowed
  * @return string WURFL ID
  */
 public function ldMatch($tolerance = null)
 {
     if ($this->simulation) {
         return WurflConstants::NO_MATCH;
     }
     if ($this->wurfl->db->db_implements_ld) {
         return $this->wurfl->db->getDeviceFromUA_LD($this->userAgent->normalized, $tolerance, $this);
     }
     $this->updateDeviceList();
     return UserAgentUtils::ldMatch($this->userAgent->normalized, $tolerance, $this);
 }
 /**
  * Attempts to match given user agent string to a device from the database by calculating their Levenshtein Distance (LD)
  * @param String User agent
  * @param int Tolerance, how much difference is allowed
  * @return String WURFL ID
  */
 public function ldMatch($ua, $tolerance = NULL)
 {
     if ($this->wurfl->db->db_implements_ld) {
         return $this->wurfl->db->getDeviceFromUA_LD($ua, $tolerance, $this);
     }
     $this->updateDeviceList();
     return UserAgentUtils::ldMatch($ua, $tolerance, $this);
 }