コード例 #1
0
ファイル: ex6.py プロジェクト: kamalgovind/bossmashup
def parse_year(s):
  years = filter(lambda t: len(t) == 4 and t.startswith("19") or t.startswith("200"), text.uniques(s))
  if len(years) > 0:
    return text.norm(years[0])
コード例 #2
0
ファイル: ex6.py プロジェクト: kamalgovind/bossmashup
def parse_month(s):
  months = filter(lambda m: m is not None, map(month_lookup, text.uniques(s)))
  if len(months) > 0:
    return text.norm(months[0])