pwdyson/inflect.py — pull request #9 by mgrachten (2012-08-14 22:15:21+00:00)
Title: Minor bug fix in engine.singular_noun()

Hi Paul,

when issueing for example

engine.singular_noun('bag-of-words')

I got this error:

Traceback (most recent call last):
File "", line 1, in
File "inflect.py", line 1755, in singular_noun
sing = self._sinoun(word, count=count, gender=gender)
File "inflect.py", line 2390, in _sinoun
'-' + lowersplit[numword] + '-']) + \
TypeError: unsupported operand type(s) for +: 'bool' and 'str'

if the _sinoun call one of the earlier terms evaluates to False, the + with the strings fail. I assume the expected behavior should be to return False, that's what I've changed it to do.

Hope it helps.

Cheers,

Maarten Grachten