From b0c32a130bc5cc64f158e07b4d6d3bc3fde7d197 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 1 Aug 2023 17:58:31 -0400 Subject: [PATCH] fix: no longer using inflect --- sugoncredit/sugoncredit.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sugoncredit/sugoncredit.py b/sugoncredit/sugoncredit.py index c3793bf..f68b6b5 100644 --- a/sugoncredit/sugoncredit.py +++ b/sugoncredit/sugoncredit.py @@ -1,7 +1,6 @@ import sqlite3 from sqlite3 import Error import discord -import inflect from redbot.core import Config, checks, commands, data_manager from tabulate import tabulate @@ -24,8 +23,15 @@ class SugonCredit(commands.Cog): con.close() def pluralize(word, count): - p = inflect.engine() - return p.plural(word, count) + if count == 1: + 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): """Adds a new table for a guild to the SQLite databse."""