From 8b2cd65526f7535ab43266653bd1146add8bd880 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Thu, 7 Jun 2018 02:35:19 +0200 Subject: Added generic Help system added EasyCompare as static method --- DiscoBot/Auxiliary/CommandInfo.cs | 24 ++++++++++++++++++++++++ DiscoBot/Auxiliary/SpellCorrect.cs | 9 +++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 DiscoBot/Auxiliary/CommandInfo.cs (limited to 'DiscoBot/Auxiliary') diff --git a/DiscoBot/Auxiliary/CommandInfo.cs b/DiscoBot/Auxiliary/CommandInfo.cs new file mode 100644 index 0000000..b08ba1b --- /dev/null +++ b/DiscoBot/Auxiliary/CommandInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DiscoBot.Auxiliary +{ + public struct CommandInfo + { + public CommandInfo(string name, string description, string scope) + { + this.Name = name; + this.Scope = scope; + this.Description = description; + } + + public string Name { get; } + + public string Scope { get; } + + public string Description { get; } + } +} diff --git a/DiscoBot/Auxiliary/SpellCorrect.cs b/DiscoBot/Auxiliary/SpellCorrect.cs index 4f4f7d0..01cce62 100644 --- a/DiscoBot/Auxiliary/SpellCorrect.cs +++ b/DiscoBot/Auxiliary/SpellCorrect.cs @@ -9,6 +9,11 @@ public const int ErrorThreshold = 94100; public override int Compare(string x, string y) + { + return CompareEasy(x, y); + } + + public static int CompareEasy(string x, string y) { if (string.IsNullOrEmpty(x)) { @@ -47,7 +52,7 @@ return score + 1; } - return 100000 - (int)(this.CompareExact(x, y) * 1000.0); + return 100000 - (int)(CompareExact(x, y) * 1000.0); /*if (y.Contains(x)) return 6;*/ } @@ -63,7 +68,7 @@ throw new NotImplementedException(); } - public double CompareExact(string s, string q) + public static double CompareExact(string s, string q) { s = s.ToLower(); -- cgit v1.2.3-54-g00ecf