/// <summary> /// Verify the dictionary has this word already /// </summary> /// <param name="lexeme">dictata to check</param> public static ILexeme VerifyLexeme(ILexeme lexeme) { if (lexeme == null || string.IsNullOrWhiteSpace(lexeme.Name) || lexeme.Name.IsNumeric()) { return(null); } //Set the language to default if it is absent and save it, if it has a language it already exists if (lexeme.Language == null) { IGlobalConfig globalConfig = ConfigDataCache.Get <IGlobalConfig>(new ConfigDataCacheKey(typeof(IGlobalConfig), "LiveSettings", ConfigDataType.GameWorld)); if (globalConfig.BaseLanguage != null) { lexeme.Language = globalConfig.BaseLanguage; } } ConfigDataCacheKey cacheKey = new ConfigDataCacheKey(lexeme); ILexeme maybeLexeme = ConfigDataCache.Get <ILexeme>(cacheKey); if (maybeLexeme != null) { lexeme = maybeLexeme; } lexeme.IsSynMapped = false; lexeme.MapSynNet(); lexeme.FillLanguages(); return(lexeme); }