/// <summary>Gets the PosTag string corresponding to the System.Type of the given <see cref="Phrase" />.</summary> /// <param name="phrase"> /// The <see cref="Phrase" /> for which to get the corresponding tag. /// </param> /// <returns>The PosTag string corresponding to the System.Type of the given LASI.Algorithm.Phrase.</returns> public override string this[Phrase phrase] { get { try { return(map.First(funcPosTagPair => funcPosTagPair.Value.Method.ReturnType == phrase.GetType()).Key); } catch (InvalidOperationException) { throw new UnmappedPhraseTypeException(phrase.GetType(), typeof(SharpNLPPhraseTagsetMap)); } } }
public void PhraseConstructor_CreatesInstancesOfPhrase_Phrase() { Phrase newPhrase = new Phrase("test", "test"); Assert.AreEqual(typeof(Phrase), newPhrase.GetType()); }
public override string this[Phrase phrase] => (from mapping in mappings where mapping.Value.Invoke(new Word[] { }).GetType() == phrase.GetType() select mapping.Key).Single();
public void PhraseObIsCreated() { Phrase newPhrase = new Phrase(); Assert.AreEqual(typeof(Phrase), newPhrase.GetType()); }