fix: no longer using inflect
This commit is contained in:
parent
8759ee1820
commit
b0c32a130b
1 changed files with 9 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from sqlite3 import Error
|
from sqlite3 import Error
|
||||||
import discord
|
import discord
|
||||||
import inflect
|
|
||||||
from redbot.core import Config, checks, commands, data_manager
|
from redbot.core import Config, checks, commands, data_manager
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
|
@ -24,8 +23,15 @@ class SugonCredit(commands.Cog):
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
def pluralize(word, count):
|
def pluralize(word, count):
|
||||||
p = inflect.engine()
|
if count == 1:
|
||||||
return p.plural(word, count)
|
return word
|
||||||
|
elif word.endswith('s') or word.endswith('x') or word.endswith('z') or word.endswith('ch') or word.endswith('sh'):
|
||||||
|
return word + 'es'
|
||||||
|
elif word.endswith('y'):
|
||||||
|
# Change 'y' to 'ies' for words ending with a consonant + 'y'
|
||||||
|
return word[:-1] + 'ies'
|
||||||
|
else:
|
||||||
|
return word + 's'
|
||||||
|
|
||||||
def new_guild_generation(self, guild_id):
|
def new_guild_generation(self, guild_id):
|
||||||
"""Adds a new table for a guild to the SQLite databse."""
|
"""Adds a new table for a guild to the SQLite databse."""
|
||||||
|
|
Loading…
Reference in a new issue