fixed pluralize

This commit is contained in:
Rocky Duan
2012-08-23 02:52:51 -07:00
parent f2507d7c52
commit e4890a8bff
2 changed files with 3 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ import urllib
import os
def pluralize(singular_term, count):
if int(count) >= 2:
if int(count) >= 2 or int(count) == 0:
return singular_term + 's'
return singular_term

View File

@@ -7,7 +7,8 @@ import inspect
def pluralize(content, text):
num, word = text.split(' ')
if int(num or '0') >= 2:
num = int(num or '0')
if num >= 2 or num == 0:
return word + 's'
else:
return word