Rev 4129 | Blame | Compare with Previous | Last modification | View Log | RSS feed
def getscore(struct) :score = 0.0category = struct.get("category")if struct.has_key("features") :features = struct.get("features")if category == "Tablets" :# GPRS : 1, 0if features.has_key("GPRS") :score += 10*10# EDGE : 1, 0if features.has_key("EDGE") :score += 10*10# 3G : 2, 0if features.has_key("3G") :score += 10*10# WLAN : 2, 0if features.has_key("Wi-Fi") :score += 10*10# Bluetooth : 1, 0if features.has_key("Bluetooth") :score += 10*10# USB : 1, 0if features.has_key("USB") :score += 10*10# USB Port: 1, 0if features.has_key("USB port") :score += 10*10# USB Port: 1, 0if features.has_key("Docking port") :score += 10*10# HDMI Port: 1, 0if features.has_key("HDMI port") :score += 10*10# Card slot: 1, 0if features.has_key("Card slot") :score += 10*10else:# GPRS : 1, 0if features.has_key("GPRS") :score += 10*15# EDGE : 1, 0#if features.has_key("EDGE") :# score += 10*10# 3G : 2, 0if features.has_key("3G") :score += 10*25# WLAN : 2, 0if features.has_key("Wi-Fi") :score += 10*20# Bluetooth : 1, 0if features.has_key("Bluetooth") :score += 10*10# USB : 1, 0if features.has_key("USB") :score += 10*10# NFCif features.has_key("NFC") :score += 10*5# GPSif features.has_key("GPS type") :gps_type = features.get("GPS type")if "Integrated GPS" in gps_type :score += 5*15if "A-GPS" in gps_type :score += 5*15score = score / 100return score