public void MatchSingleString_Ask2() { var result = new Pronoun("pronouns: ask", s); Assert.AreEqual(result.value, PronounFlags.ASK); Assert.AreEqual("ask", result.ToString()); }
public void MatchSingleString_Any2() { var result = new Pronoun("pronouns: any", s); Assert.AreEqual(result.value, PronounFlags.ALL); Assert.AreEqual("any/all", result.ToString()); }
public void NoMatchEmptyString() { var result = new Pronoun("", s); Assert.AreEqual(result.value, PronounFlags.NONE); Assert.AreEqual("none", result.ToString()); }
public void MatchSingleString_It() { var result = new Pronoun("it", s); Assert.AreEqual(result.value, PronounFlags.IT); Assert.AreEqual("it/it", result.ToString()); }
public void NoMatchJunkDigitsString() { var result = new Pronoun("1111", s); Assert.AreEqual(result.value, PronounFlags.NONE); Assert.AreEqual("none", result.ToString()); }
private void UpdateGenderedTermVariablesForCharacter(DynamicGenderCharacter character) { Pronoun?pronounOrNull = ReadPronounFromFungusVar(character.PronounVarName); if (!pronounOrNull.HasValue) { Debug.LogWarning("Unable to load Fungus variables for character: " + character.Name); return; } Pronoun pronoun = pronounOrNull.Value; Dictionary <GenderedTermType, string> genderedTermsByTermType = GenderedTermDictionary.GetGenderedTermsForPronoun(pronoun); foreach (KeyValuePair <GenderedTermType, string> gameScriptVarNamePair in character.GameScriptVarNames) { GenderedTermType termType = gameScriptVarNamePair.Key; string gameScriptVarName = gameScriptVarNamePair.Value; string genderedTerm; if (!genderedTermsByTermType.TryGetValue(termType, out genderedTerm)) { Debug.LogWarning("Unknown gendered term type \"" + termType.ToString() + "\" for " + character.Name + "not in dictionary."); continue; } // check if we need to capitalize this gendered term if (gameScriptVarName.Contains(DynamicGenderCharacterGameData.CAP_SUFFIX)) { genderedTerm = CapitalizeString(genderedTerm); } fungusHelper.UpdateVariable(gameScriptVarName, genderedTerm); } }
public static Token ParseWord(this string word) { word = word.Trim().ToLower(); if (Verb.Propose(word)) { return(new Verb(word)); } if (Noun.Propose(word)) { return(new Noun(word)); } if (Article.Propose(word)) { return(new Article(word)); } if (Preposition.Propose(word)) { return(new Preposition(word)); } if (Pronoun.Propose(word)) { return(new Pronoun(word)); } throw new Exception(String.Format("Can't parse {0}", word)); }
public void PronounsFromProfile_5() { var result = new Pronoun("I'm a streamer, 99 years old, ⛳. She/Her. I enjoy Splatoon.", s); Assert.AreEqual(result.value, PronounFlags.SHE); Assert.AreEqual("she/her", result.ToString()); }
public void PronounsFromProfile_6() { var result = new Pronoun("I like Splatoon `he/him/ne`.", s); Assert.AreEqual(result.value, PronounFlags.HE | PronounFlags.NEO); Assert.AreEqual("he/" + Pronoun.NEO_PLACEHOLDER, result.ToString()); }
public void PronounsFromProfile_3() { var result = new Pronoun("They/Them - 99 - UTC", s); Assert.AreEqual(result.value, PronounFlags.THEY); Assert.AreEqual("they/them", result.ToString()); }
public void PronounsFromProfile_4() { var result = new Pronoun("Name/Nick - they/she", s); Assert.AreEqual(result.value, PronounFlags.SHE | PronounFlags.THEY | PronounFlags.ORDER_RTL); Assert.AreEqual("they/she", result.ToString()); }
public void PronounsFromProfile_2() { var result = new Pronoun("he/him or they/them pronouns please", s); Assert.AreEqual(result.value, PronounFlags.HE | PronounFlags.THEY); Assert.AreEqual("he/they", result.ToString()); }
public void PronounsFromProfile_1() { var result = new Pronoun("**she/they** • chaotic kazoo bard •", s); Assert.AreEqual(result.value, PronounFlags.SHE | PronounFlags.THEY); Assert.AreEqual("she/they", result.ToString()); }
public void PronounsInsideTextShouldBeParsed_Reverse() { var result = new Pronoun("This is a player description with some pronouns they/she with an fc 0123-4567-8912", s); Assert.AreEqual(result.value, PronounFlags.SHE | PronounFlags.THEY | PronounFlags.ORDER_RTL); Assert.AreEqual("they/she", result.ToString()); }
public void MatchSingleString_He() { var result = new Pronoun("he", s); Assert.AreEqual(result.value, PronounFlags.HE); Assert.AreEqual("he/him", result.ToString()); }
public void MatchSingleString_She2() { var result = new Pronoun("She/her", s); Assert.AreEqual(result.value, PronounFlags.SHE); Assert.AreEqual("she/her", result.ToString()); }
public Breed( string name, Pronoun pronoun, Glyph glyph, List <Attack> attacks, List <Move> moves, Drop drop, int maxHealth, int tracking, int meander, int speed, List <string> flags, string slug) { this.name = name; Pronoun = pronoun; Appearance = new Appearence { Glyph = glyph.Appearance, ForeGroundColor = glyph.Fore, Slug = slug, Type = AppearenceType.Monster }; Attacks = attacks; Moves = moves; Drop = drop; MaxHealth = maxHealth; Tracking = tracking; Meander = meander; Speed = speed; Flags = flags; if (Flags.Contains("")) { throw new ArgumentException(); } }
public IActionResult Create(Pronoun pronoun) { if (ModelState.IsValid) { if (pronoun != null) { var find_pronoun = db.Pronouns.FirstOrDefault(w => w.PronounEng == pronoun.PronounEng); var find_word = db.Words.FirstOrDefault(w => w.WordEng == pronoun.PronounEng); if (find_pronoun == null) { db.Pronouns.Add(pronoun); var word = new Word() { WordEng = pronoun.PronounEng, WordRu = pronoun.PronounRu }; db.Words.Add(word); db.SaveChanges(); } else { find_pronoun.PronounRu = pronoun.PronounRu; db.Pronouns.Update(find_pronoun); db.SaveChanges(); } return(RedirectToAction(nameof(Index))); } } return(View(pronoun)); }
/// <summary> /// Determines if the Pronoun is among the semantic categories which are thought of as /// explicitly gender neutral. /// </summary> /// <param name="pronoun">The Pronoun to test.</param> /// <returns> /// <c>true</c> if the Pronoun is among the semantic categories which are thought of as /// explicitly gender neutral; otherwise, <c>false</c>. /// </returns> public static bool IsNeutral(this Pronoun pronoun) { var kind = pronoun.PronounKind; //var intSet = new[] { 1, 2, 3, 4, 5, 6, 7 }.ToSet((i, j) => i % 2 == j % 2, i => i.GetHashCode()); return(kind == PronounKind.GenderNeurtral || kind == PronounKind.GenderNeurtralReflexive); }
public void OnPronounChosen(int pronoun) { PlayerPronoun = (Pronoun)pronoun; AkSoundEngine.PostEvent("ChoicePick", gameObject); //Debug.Log("Chose pronoun " + PlayerPronoun); }
public Hero(Game game, VectorBase pos, HeroSave save, Pronoun pronoun, string name) : base(game, pos.x, pos.y, Option.HeroHealthStart, new Noun("Hero"), pronoun) { HeroClass = save.HeroClass.Clone(); Inventory = save.Inventory.clone(); Equipment = save.Equipment.clone(); BackPack = save.BackPack.clone(); Crucible = save.Crucible.clone(); ExperienceCents = save.ExperienceCents; Gold = save.Gold; // Hero state is cloned so that if they die in the dungeon, they lose // anything they found. RefreshLevel(false); HeroClass.Bind(this); // Give the hero energy so we can act before all of the monsters. Energy.CurrentEnergy = Energy.ActionCost; // Start with some initial ability to rest so we aren't weakest at the very // beginning. Food = save.Food; Health = save.Health; Charge = save.Charge; this.Name = name; }
/// <summary> /// Evaluates a <c>pron</c> wildcard, replacing the string with the adequate pronoun /// regarding the last token found. /// </summary> /// <param name="w">The wilcard to find a replacement for</param> /// <returns>An appropiate replacement for the wildcard.</returns> private void EvaluatePronoun(Wildcard w) { Wildcard prev = null; string keycode; string keyword; for (int i = currentWildcardIx - 1; i >= 0; --i) { keycode = textWildcards [i].Keycode; keyword = wildcards [keycode].Keyword; if ((keyword != null) && keyword.IsAnyOf("name", "male", "female")) { // prev = textWildcards [i]; prev = wildcards [keycode]; break; } } for (int i = currentWildcardIx - 1; (prev == null) && (i >= 0); --i) { keycode = textWildcards [i].Keycode; keyword = wildcards [keycode].Keyword; if ((keyword != null) && keyword.IsAnyOf("void", "pron")) { continue; } // prev = textWildcards [i]; prev = wildcards [keycode]; break; } w.Replacement = new NamedTaskElement(Pronoun.FromWildcard(w, prev)); }
public static string GetThem(Pronoun pronoun) { switch ((int)pronoun) { case 0: return("them"); case 1: return("her"); case 2: return("him"); case 3: return("xem"); case 4: return("zir"); case 5: return("hir"); case 6: return("it"); default: return(pronounsNotOnList[1]); } }
public static string GetTheir(Pronoun pronoun) { switch ((int)pronoun) { case 0: return("they"); case 1: return("her"); case 2: return("his"); case 3: return("xyr"); case 4: return("zir"); case 5: return("hir"); case 6: return("its"); default: return(pronounsNotOnList[2]); } }
public static string GetThey(Pronoun pronoun) { switch ((int)pronoun) { case 0: return("they"); case 1: return("she"); case 2: return("he"); case 3: return("xe"); case 4: return("ze"); case 5: return("ze"); case 6: return("it"); default: return(pronounsNotOnList[0]); } }
public void MatchSingleString_They() { var result = new Pronoun("they", s); Assert.AreEqual(result.value, PronounFlags.THEY); Assert.AreEqual("they/them", result.ToString()); }
public void PronounsInsideTextShouldBeParsed() { var result = new Pronoun("This is a player description with some pronouns he/she/they with an fc 0123-4567-8912", s); Assert.AreEqual(result.value, PronounFlags.HE | PronounFlags.SHE | PronounFlags.THEY); Assert.AreEqual("he/she/they", result.ToString()); }
public void MatchMultipleString_SheNeo_Reverse() { const string test = "ve/she"; var result = new Pronoun(test, s); Assert.AreEqual(result.value, PronounFlags.SHE | PronounFlags.NEO | PronounFlags.ORDER_RTL); Assert.AreEqual(Pronoun.NEO_PLACEHOLDER + "/she", result.ToString()); }
public void MatchSingleString_They2() { const string test = "they/them"; var result = new Pronoun(test, s); Assert.AreEqual(result.value, PronounFlags.THEY); Assert.AreEqual(test, result.ToString()); }
public void MatchSingleString_He2() { const string test = "he/him"; var result = new Pronoun(test, s); Assert.AreEqual(result.value, PronounFlags.HE); Assert.AreEqual(test, result.ToString()); }