C# Class SIL.FieldWorks.FixData.MorphBundleFixer

This fixer handles cases where a WfiMorphBundle has a dangling MSA pointer. - if it has a sense that has an MSA, the MSA is fixed to point to it. - if it has a morph that belongs to a valid entry that has only one MSA, the MSA is fixed to point to it. Also, if it has a dangling Morph pointer, - if it has a sense that belongs to an entry with only a LexemeForm and no allomorphs, the Morph is fixed to point to that Lexeme form. If a good fix cannot be made the dangling objsur should be removed. (The usual removal in OriginalFixer has been suppressed to let this one try for a better fix first). Also correctly fixes an MSA pointer that is not originally dangling, but will become so because the MSA will be deleted for lack of any referring senses.
Inheritance: RtFixer
Exibir arquivo Open project: sillsdev/FieldWorks

Public Methods

Method Description
MorphBundleFixer ( GrammaticalSenseFixer senseFixer ) : System

Private Methods

Method Description
ChildSurrogateGuid ( System.Xml.Linq.XElement parent, string childName ) : string

If parent has a child with the specified name, which has an objsur child with a guid attribute, return the value of that attribute. Otherwise, null.

FixElement ( System.Xml.Linq.XElement rt, FwDataFixer logger ) : bool

This is the main routine that does actual repair on morph bundles.

FixMorph ( System.Xml.Linq.XElement rt, FwDataFixer logger, string guidString ) : void

Deal with problems of the Morph child, if any.

FixMsa ( System.Xml.Linq.XElement rt, FwDataFixer logger, string guidString ) : void

Make any required fixes to the MSA child element.

GetSoleForm ( System.Xml.Linq.XElement entryElt ) : string

Get the Lexeme Form guid, if one is present and there are no alternate forms; otherwise, return null. Enhance JohnT: arguably we could return a single AlternateForm if there is no LF, but this is pathological and unlikely to be useful.

GetSoleMsaGuid ( System.Xml.Linq.XElement rt ) : string

Get the guid of the one and only msa of rt (which is an Entry) (or return null if it does not have exactly one MSA that will survive fixup)

InspectElement ( System.Xml.Linq.XElement rt ) : void

First pass: gather information: remember all the lex entries, and the senses which have msas. Enhance JohnT: should we do something to verify that the msa refs in the senses are not also dangling?

Reset ( ) : void
SurrogateGuid ( System.Xml.Linq.XElement parent ) : string

Method Details

MorphBundleFixer() public method

public MorphBundleFixer ( GrammaticalSenseFixer senseFixer ) : System
senseFixer GrammaticalSenseFixer
return System