diff --git a/JL.Core/Dicts/CustomWordDict/CustomWordRecord.cs b/JL.Core/Dicts/CustomWordDict/CustomWordRecord.cs index 20ecb532..db13120d 100644 --- a/JL.Core/Dicts/CustomWordDict/CustomWordRecord.cs +++ b/JL.Core/Dicts/CustomWordDict/CustomWordRecord.cs @@ -28,26 +28,37 @@ public CustomWordRecord(string primarySpelling, string[]? alternativeSpellings, public string BuildFormattedDefinition(DictOptions options) { - string tempWordClass; - if (WordClasses.Contains("adj-i")) + string? tempWordClass = null; + for (int i = 0; i < WordClasses.Length; i++) { - tempWordClass = "adjective"; - } - else if (WordClasses.Contains("noun")) - { - tempWordClass = "noun"; - } - else if (WordClasses.Contains("other")) - { - tempWordClass = "other"; - } - else if (HasUserDefinedWordClass) - { - tempWordClass = string.Join(", ", WordClasses); + string wordClass = WordClasses[i]; + if (wordClass is "adj-i") + { + tempWordClass = "adjective"; + break; + } + else if (wordClass is "noun") + { + tempWordClass = "noun"; + break; + } + else if (wordClass is "other") + { + tempWordClass = "other"; + break; + } } - else + + if (tempWordClass is null) { - tempWordClass = "verb"; + if (HasUserDefinedWordClass) + { + tempWordClass = string.Join(", ", WordClasses); + } + else + { + tempWordClass = "verb"; + } } if (Definitions.Length is 1)