/// <summary>Make a new label with this <code>String</code> as the "name".</summary> /// <param name="labelStr">The string to use as a label</param> /// <returns>The newly created Label</returns> public virtual ILabel NewLabelFromString(string labelStr) { CategoryWordTag cwt = new CategoryWordTag(); cwt.SetFromString(labelStr); return(cwt); }
public virtual void TestCopy() { CategoryWordTag tag = new CategoryWordTag("A", "B", "C"); NUnit.Framework.Assert.AreEqual("A", tag.Category()); NUnit.Framework.Assert.AreEqual("B", tag.Word()); NUnit.Framework.Assert.AreEqual("C", tag.Tag()); CategoryWordTag tag2 = new CategoryWordTag(tag); NUnit.Framework.Assert.AreEqual("A", tag2.Category()); NUnit.Framework.Assert.AreEqual("B", tag2.Word()); NUnit.Framework.Assert.AreEqual("C", tag2.Tag()); }
public virtual void TestCopy() { CategoryWordTag tag = new CategoryWordTag("A", "B", "C"); NUnit.Framework.Assert.AreEqual("A", tag.Category()); NUnit.Framework.Assert.AreEqual("B", tag.Word()); NUnit.Framework.Assert.AreEqual("C", tag.Tag()); CategoryWordTagFactory lf = new CategoryWordTagFactory(); ILabel label = lf.NewLabel(tag); NUnit.Framework.Assert.IsTrue(label is CategoryWordTag); CategoryWordTag tag2 = (CategoryWordTag)label; NUnit.Framework.Assert.AreEqual("A", tag2.Category()); NUnit.Framework.Assert.AreEqual("B", tag2.Word()); NUnit.Framework.Assert.AreEqual("C", tag2.Tag()); }