private static POSDictionary SerializeDeserializeDict(POSDictionary dict) { using (var data = new MemoryStream()) { dict.Serialize(new UnclosableStream(data)); data.Seek(0, SeekOrigin.Begin); return new POSDictionary(data); } }
private static POSDictionary SerializeDeserializeDict(POSDictionary dict) { using (var data = new MemoryStream()) { dict.Serialize(new UnclosableStream(data)); data.Seek(0, SeekOrigin.Begin); return(new POSDictionary(data)); } }
public void TestSerialization() { var dict = new POSDictionary(); dict.Put("a", "1", "2", "3"); dict.Put("b", "4", "5", "6"); dict.Put("c", "7", "8", "9"); dict.Put("Always", "RB", "NNP"); Assert.AreEqual(dict, SerializeDeserializeDict(dict)); }
public void TestSerialization() { var dict = new POSDictionary(); dict.Put("a", "1", "2", "3"); dict.Put("b", "4", "5", "6"); dict.Put("c", "7", "8", "9"); dict.Put("Always", "RB", "NNP"); Assert.AreEqual(dict, SerializeDeserializeDict(dict)); }
protected void ValidatePOSDictionary(POSDictionary posDic, AbstractModel posModel) { if (!posModel.ContainsOutcomes(posDic)) { throw new InvalidFormatException("Tag dictionary contains tags which are unknown by the model!"); } }