本文整理匯總了Python中semantic.dates.DateService.extractDates方法的典型用法代碼示例。如果您正苦於以下問題:Python DateService.extractDates方法的具體用法?Python DateService.extractDates怎麽用?Python DateService.extractDates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類semantic.dates.DateService
的用法示例。
在下文中一共展示了DateService.extractDates方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: compareDates
# 需要導入模塊: from semantic.dates import DateService [as 別名]
# 或者: from semantic.dates.DateService import extractDates [as 別名]
def compareDates(self, input, targets):
service = DateService()
results = service.extractDates(input)
for (result, target) in zip(results, targets):
self.assertEqual(result.month, target.month)
self.assertEqual(result.day, target.day)
示例2: compareTimes
# 需要導入模塊: from semantic.dates import DateService [as 別名]
# 或者: from semantic.dates.DateService import extractDates [as 別名]
def compareTimes(self, input, targets):
service = DateService()
results = service.extractDates(input)
for (result, target) in zip(results, targets):
self.assertEqual(result.hour, target.hour)
self.assertEqual(result.minute, target.minute)
示例3: compareTimes
# 需要導入模塊: from semantic.dates import DateService [as 別名]
# 或者: from semantic.dates.DateService import extractDates [as 別名]
def compareTimes(self, input, targets):
service = DateService()
results = service.extractDates(input)
for (result, target) in zip(results, targets):
self.assertEqual(target.time(), result.time())