コード例 #1
0
		private static XElement ExportSenses(IRepository<ILexSense> senseRepos, Icu.UNormalizationMode mode)
		{
			return new XElement("Senses",
				from sense in senseRepos.AllInstances()
				select new XElement("LexSense",
					new XAttribute("Id", sense.Hvo),
					CreateAttribute("Msa", sense.MorphoSyntaxAnalysisRA),
					ExportBestAnalysis(sense.Gloss, "Gloss", mode),
					ExportBestAnalysis(sense.Definition, "Definition", mode)));
		}
コード例 #2
0
		private static XElement ExportEntries(IRepository<ILexEntry> entryRepos)
		{
			return new XElement("Entries",
				from entry in entryRepos.AllInstances()
				select new XElement("LexEntry",
					new XAttribute("Id", entry.Hvo),
					new XElement("CitationForm", entry.CitationFormWithAffixType),
					from altForm in entry.AlternateFormsOS
					select ExportItemAsReference(altForm, entry.AlternateFormsOS.IndexOf(altForm), "AlternateForms"),
					new XElement("LexemeForm",
						CreateDstAttribute(entry.LexemeFormOA),
						// Protect against a null LexemeFormOA.  See FWR-3251.
						CreateAttribute("MorphType", entry.LexemeFormOA == null ? null : entry.LexemeFormOA.MorphTypeRA)),
						from sense in entry.AllSenses
						select ExportItemAsReference(sense, "Sense"),
						from msa in entry.MorphoSyntaxAnalysesOC
						select ExportItemAsReference(msa, "MorphoSyntaxAnalysis"),
						from lexEntryRef in entry.VariantEntryRefs
						 select new XElement("LexEntryRef",
							 from componentLexemes in lexEntryRef.ComponentLexemesRS
							 select ExportItemAsReference(componentLexemes, "ComponentLexeme"),
						from lexEntryType in lexEntryRef.VariantEntryTypesRS
							select ExportItemAsReference(lexEntryType, "LexEntryType"))));
		}
コード例 #3
0
		private static XElement ExportMorphTypes(IRepository<IMoMorphType> morphTypeRepository, Icu.UNormalizationMode mode)
		{
			return new XElement("MoMorphTypes",
				from morphType in morphTypeRepository.AllInstances()
				select new XElement("MoMorphType",
					new XAttribute("Id", morphType.Hvo),
					new XAttribute("Guid", morphType.Guid.ToString()),
					ExportBestAnalysis(morphType.Name, "Name", mode),
					ExportBestAnalysis(morphType.Abbreviation, "Abbreviation", mode),
					ExportBestAnalysis(morphType.Description, "Description", mode),
					new XElement("NumberOfLexEntries", morphType.NumberOfLexEntries)));
		}
コード例 #4
0
		private static XElement ExportLexEntryInflTypes(IRepository<ILexEntryInflType> irregularlyInflectedFormTypeRepository, Icu.UNormalizationMode mode)
		{
			return new XElement("LexEntryInflTypes",
								from irregularlyInflectedForm in irregularlyInflectedFormTypeRepository.AllInstances()
								select new XElement("LexEntryInflType",
													new XAttribute("Id", irregularlyInflectedForm.Hvo),
													new XAttribute("Guid", irregularlyInflectedForm.Guid.ToString()),
													ExportBestAnalysis(irregularlyInflectedForm.Name, "Name", mode),
													ExportBestAnalysis(irregularlyInflectedForm.Abbreviation, "Abbreviation",
																	   mode),
													ExportBestAnalysis(irregularlyInflectedForm.Description, "Description", mode),
													ExportBestAnalysis(irregularlyInflectedForm.GlossPrepend, "GlossPrepend", mode),
													ExportBestAnalysis(irregularlyInflectedForm.GlossAppend, "GlossAppend", mode),
													from slot in irregularlyInflectedForm.SlotsRC
													select ExportItemAsReference(slot, "Slots"),
													new XElement("InflectionFeatures",
																 ExportFeatureStructure(irregularlyInflectedForm.InflFeatsOA))));
		}
コード例 #5
0
		private static XElement ExportCompoundRules(IRepository<IMoEndoCompound> endoCmpRepository, IRepository<IMoExoCompound> exoCmpRepository,
			Icu.UNormalizationMode mode)
		{
			return new XElement("CompoundRules",
				from endoCompound in endoCmpRepository.AllInstances()
				where !endoCompound.Disabled
				select new XElement("MoEndoCompound",
					new XAttribute("Id", endoCompound.Hvo),
					new XAttribute("HeadLast", endoCompound.HeadLast ? 1 : 0),
					ExportBestAnalysis(endoCompound.Name, "Name", mode),
					ExportBestAnalysis(endoCompound.Description, "Description", mode),
					ExportItemAsReference(endoCompound.LeftMsaOA, "LeftMsa"),
					ExportItemAsReference(endoCompound.RightMsaOA, "RightMsa"),
					from prod in endoCompound.ToProdRestrictRC
					select ExportItemAsReference(prod, "ToProdRestrict"),
					ExportItemAsReference(endoCompound.OverridingMsaOA, "OverridingMsa")),
				from exoCompound in exoCmpRepository.AllInstances()
				where !exoCompound.Disabled
				select new XElement("MoExoCompound",
					new XAttribute("Id", exoCompound.Hvo),
					ExportBestAnalysis(exoCompound.Name, "Name", mode),
					ExportBestAnalysis(exoCompound.Description, "Description", mode),
					ExportItemAsReference(exoCompound.LeftMsaOA, "LeftMsa"),
					ExportItemAsReference(exoCompound.RightMsaOA, "RightMsa"),
					from prod in exoCompound.ToProdRestrictRC
					select ExportItemAsReference(prod, "ToProdRestrict"),
					ExportItemAsReference(exoCompound.ToMsaOA, "ToMsa")));
		}