You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inflect pip installed into virtual environment running python3.7 on ubuntu 18.04
After getting an error I wrote some debug statements into inflect.py starting on line 2215:
def postprocess(self, orig, inflected):
inflected = str(inflected)
print("Inflected: " + inflected)
if "|" in inflected:
inflected = inflected.split("|")[self.classical_dict["all"]]
result = inflected.split(" ")
print("Orig: " + orig)
print("Inflected: " + inflected)
# Try to fix word wise capitalization
for index, word in enumerate(orig.split(" ")):
...
My code:
>>> import inflect
>>> p = inflect.engine()
>>> p.classical(all=True)
>>> p.plural("Genie")
Inflected: genies|genii
Orig: Genie
Inflected: genii
'Genii'
>>> p.plural("Master Genie")
Inflected: Master genies|genii
Orig: Master Genie
Inflected: genii
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/omitted/for/privacy/lib/python3.7/site-packages/inflect.py", line 2260, in plural
or self._plnoun(word, count),
File "/omitted/for/privacy/lib/python3.7/site-packages/inflect.py", line 2230, in postprocess
result[index] = result[index].capitalize()
IndexError: list index out of range
So it looks like something went wrong in this line:
inflected = inflected.split("|")[self.classical_dict["all"]]
Instead of returning "master genii" it returns just "genii"
Ninja Edit: This would be occuring on line 2226 in postprocess without the debug statements
The text was updated successfully, but these errors were encountered:
Inflect pip installed into virtual environment running python3.7 on ubuntu 18.04
After getting an error I wrote some debug statements into inflect.py starting on line 2215:
My code:
So it looks like something went wrong in this line:
inflected = inflected.split("|")[self.classical_dict["all"]]
Instead of returning "master genii" it returns just "genii"
Ninja Edit: This would be occuring on line 2226 in postprocess without the debug statements
The text was updated successfully, but these errors were encountered: