コード例 #1
0
 def jobUs(no: int, url: str):
     switcher = {
         0: url_and_domain.isDomainHavingNonAscii(url),
         1: url_and_domain.isShortUrl(url),
         2: url_and_domain.isDeepLevelSubdomain(url),
         3: url_and_domain.isLowAlexaRank(url),
         4: url_and_domain.isNotIndexedByGoogle(url)
     }
     uFeatures[no] = switcher.get(no)
コード例 #2
0
 def jobUD(url: str):
     uFeatures[0] = url_and_domain.isDomainHavingNonAscii(url)
     uFeatures[1] = url_and_domain.isShortUrl(url)
     uFeatures[2] = url_and_domain.isDeepLevelSubdomain(url)
     uFeatures[3] = url_and_domain.isLowAlexaRank(url)
     uFeatures[4] = url_and_domain.isNotIndexedByGoogle(url)
コード例 #3
0
 def test2dot(self):
     self.assertEqual(
         url_and_domain.isDeepLevelSubdomain('https://a.b.c.com/abc.def/'),
         2)
コード例 #4
0
 def test1dot(self):
     self.assertEqual(
         url_and_domain.isDeepLevelSubdomain('https://a.b.com'), 1)