Exemplo n.º 1
0
        public void Add(LexSense sense)
        {
            List <string> propertiesAlreadyOutput = new List <string>();

            Writer.WriteStartElement("sense");
            Writer.WriteAttributeString("id", sense.GetOrCreateId());

            if (ShouldOutputProperty(LexSense.WellKnownProperties.PartOfSpeech))
            {
                WriteGrammi(sense);
                propertiesAlreadyOutput.Add(LexSense.WellKnownProperties.PartOfSpeech);
            }
            if (ShouldOutputProperty(LexSense.WellKnownProperties.Gloss))
            {
                // review: I (cp) don't think this has the same checking for round tripping that AddMultiText... methods have.
                WriteGlossOneElementPerFormIfNonEmpty(sense.Gloss);
                propertiesAlreadyOutput.Add(LexSense.WellKnownProperties.Gloss);
            }


            WriteWellKnownCustomMultiText(sense,
                                          LexSense.WellKnownProperties.Definition,
                                          propertiesAlreadyOutput);
            foreach (LexExampleSentence example in sense.ExampleSentences)
            {
                Add(example);
            }
            foreach (var reversal in sense.Reversals)
            {
                AddReversal(reversal);
            }
            foreach (var note in sense.Notes)
            {
                AddNote(note);
            }
            WriteWellKnownCustomMultiText(sense,
                                          PalasoDataObject.WellKnownProperties.Note,
                                          propertiesAlreadyOutput);
            //   WriteWellKnownUnimplementedProperty(sense, LexSense.WellKnownProperties.Note, propertiesAlreadyOutput);
            WriteCustomProperties(sense, propertiesAlreadyOutput);
            Writer.WriteEndElement();
        }
Exemplo n.º 2
0
		public void BlankSense()
		{
			LexSense sense = new LexSense();
			_exporter.Add(sense);
			CheckAnswer(string.Format("<sense id=\"{0}\" />", sense.GetOrCreateId()));
		}
Exemplo n.º 3
0
		private static string GetSenseElement(LexSense sense)
		{
			return string.Format("<sense id=\"{0}\">", sense.GetOrCreateId());
		}
Exemplo n.º 4
0
		public void BlankSense()
		{
			using (var session = new LiftExportAsFragmentTestSession())
			{
				var sense = new LexSense();
				session.LiftWriter.Add(sense);
				AssertEqualsCanonicalString(
					String.Format("<sense id=\"{0}\" />", sense.GetOrCreateId()),
					session.OutputString()
				);
			}
		}