Пример #1
0
 /// <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());
        }
Пример #3
0
 public override string this[Phrase phrase] =>
 (from mapping in mappings
  where mapping.Value.Invoke(new Word[] { }).GetType() == phrase.GetType()
  select mapping.Key).Single();
Пример #4
0
        public void PhraseObIsCreated()
        {
            Phrase newPhrase = new Phrase();

            Assert.AreEqual(typeof(Phrase), newPhrase.GetType());
        }