C# Class SIL.FieldWorks.FDO.FDOTests.InterlinearTestBase.ParagraphBuilder

This class can be used to build the contents of a paragraph through an xml specification. Note: the xml specification will be modified to save the expected state of the paragraph.
Show file Open project: sillsdev/FieldWorks

Private Properties

Property Type Description
BreakPhraseAnnotation bool
BuildParagraphContent IStTxtPara
CreateNewParagraph IStTxtPara
CreateSegmentForms XmlElement
CreateSegmentNode XmlElement
DeleteSegmentBreak bool
ExportCbaNodeToReal IAnalysis
GenerateParaContentFromAnnotations ITsString
GenerateWhitespace string
GetAnalysisId int
GetAnnotationTypeGuid string
GetExpectedAnalysis int
GetSegmentFormInfo XmlNode
GetWsFromStringNode int
InsertSegmentBreak bool
InsertSegmentForm bool
InvalidateParagraphInfo void
MakeTextProps ITsTextProps
MergeAdjacentAnnotations bool
ParagraphBuilder System
ParagraphBuilder System
ParagraphBuilder System
ParagraphBuilder System
ParseParagraph void
ParseParagraph void
ParseParagraph void
RebuildParagraphContentFromAnnotations ITsString
RebuildParagraphContentFromAnnotations ITsString
RebuildParagraphContentFromStrings ITsString
RemoveSegment bool
RemoveSegmentForm bool
ReplaceAttributeValue string
ReplaceLeadingWhitepace bool
ReplaceSegmentForm bool
ReplaceSegmentForm bool
ReplaceTrailingWhitepace bool
ResyncExpectedAnnotationIds void
SegmentFormNode XmlNode
SegmentFormNodeList XmlNodeList
SegmentFormNodeList XmlNodeList
SegmentFormNodes List
SegmentNode XmlNode
SegmentNodeList XmlNodeList
SegmentNodeList XmlNodeList
SegmentNodes List
SegmentNodes List
SetContents void
SetDefaultWord IWfiWordform
SetExpectedValuesForAnalysis void
SetExpectedValuesForSegment void
Snapshot XmlNode
SnapshotOfPara XmlNode
SnapshotOfStText XmlNode
StringValue string
StringValueNode XmlNode
UpdateExpectedWordformsAndOccurrences void

Public Methods

Method Description
AppendParagraph ( ) : IStTxtPara
CopyContents ( IStTxtPara paraSrc, IStTxtPara paraTarget ) : void
CreateParagraph ( int iInsertNewParaAt ) : IStTxtPara

Protected Methods

Method Description
GetStTxtParaDefnNode ( FDO text, XmlNode textsDefn, int iPara, IStTxtPara &para ) : XmlNode

Private Methods

Method Description
BreakPhraseAnnotation ( int iSegment, int iSegForm ) : bool
BuildParagraphContent ( XmlNode paraDefn ) : IStTxtPara
CreateNewParagraph ( XmlNode paraDefn ) : IStTxtPara
CreateSegmentForms ( ) : XmlElement
CreateSegmentNode ( ) : XmlElement
DeleteSegmentBreak ( int iSegment, int iSegForm ) : bool
ExportCbaNodeToReal ( int iSegment, int iSegForm ) : IAnalysis

Copies out the anaysis info in the paragraph definition cba node into the appropriate position in the real segment. Will replace the current one at that position, or may be used to add to the segment, by passing an index one too large. Returns the analysis.

GenerateParaContentFromAnnotations ( ) : ITsString
GenerateWhitespace ( int cchWhitespace ) : string
GetAnalysisId ( XmlNode cbaNode ) : int

Given an XmlNode representing a CmBaseAnnotation, find the id of the associated analysis object.

GetAnnotationTypeGuid ( XmlNode segFormNode ) : string
GetExpectedAnalysis ( int iSegment, int iSegForm ) : int
GetSegmentFormInfo ( string wordform, int iOccurrenceInParagraph, int &iSegment, int &iSegForm ) : XmlNode
GetWsFromStringNode ( XmlNode strValue ) : int
InsertSegmentBreak ( int iSegment, int iSegForm, string stringValue ) : bool
InsertSegmentForm ( int iSegment, int iSegForm, string annTypeGuid, string stringValue ) : bool

Inserts (before iSegment, iSegForm) a new SegmentForm with format: xxxpus

InvalidateParagraphInfo ( ) : void

If we change the xml definition for the paragraph, we need to rebuild the real paragraph content at some point.

MakeTextProps ( int ws ) : ITsTextProps
MergeAdjacentAnnotations ( int iSegment, int iSegForm ) : bool
ParagraphBuilder ( FdoCache cache, IFdoOwningSequence owner ) : System
ParagraphBuilder ( FdoCache cache, IFdoOwningSequence owner, XmlNode paraDefn ) : System
ParagraphBuilder ( IStTxtPara para, XmlNode paraDefn ) : System
ParagraphBuilder ( XmlNode textsDefn, FDO text, int iPara ) : System
ParseParagraph ( ) : void
ParseParagraph ( bool fResetConcordance ) : void
ParseParagraph ( bool fResetConcordance, bool fBuildConcordance ) : void
RebuildParagraphContentFromAnnotations ( ) : ITsString

(after setting paragraph contents, we'll reparse the text, creating dummy wordforms.)

RebuildParagraphContentFromAnnotations ( bool fResetConcordance ) : ITsString

RebuildParagraphContentFromStrings ( ) : ITsString
RemoveSegment ( int iSegment ) : bool
RemoveSegmentForm ( int iSegment, int iSegForm ) : bool
ReplaceAttributeValue ( XmlNode node, string attrName, string newValue ) : string
ReplaceLeadingWhitepace ( int iSegment, int iSegForm, int newExtraWhitespaceCount ) : bool
ReplaceSegmentForm ( int iSegment, int iSegForm, string newValue, int newWs ) : bool
ReplaceSegmentForm ( string segmentForm, int iOccurrenceInParagraph, string newValue ) : bool
ReplaceTrailingWhitepace ( int iSegment, int iSegForm, int newExtraWhitespaceCount ) : bool
ResyncExpectedAnnotationIds ( ) : void

Sync the expected occurrences with the database.

SegmentFormNode ( int iSegment, int iSegForm ) : XmlNode
SegmentFormNodeList ( XmlNode segmentNode ) : XmlNodeList

In the XML representation of expected data, each Segment has a SegmentForms37 property containing a sequence of CmBaseAnnotations. Given the parent node, answer the CmBaseAnnotation nodes.

SegmentFormNodeList ( int iSegment ) : XmlNodeList
SegmentFormNodes ( XmlNode segment ) : List
SegmentNode ( int iSegment ) : XmlNode
SegmentNodeList ( ) : XmlNodeList
SegmentNodeList ( XmlNode paraDefn ) : XmlNodeList

Given an XmlNode from our test data representing an StTxtPara, get the (obsolete structure) CmBaseAnnotation nodes representing its segments.

SegmentNodes ( ) : List
SegmentNodes ( XmlNode paraDefn ) : List
SetContents ( ITsString tssContents, bool fResetConcordance ) : void
SetDefaultWord ( int iSegment, int iSegForm ) : IWfiWordform

Currently, this ensures that the real analysis is set for all segments and wordforms up to the specified one. We can't have an isolated item any more, so we create earlier ones as necessary, also.

SetExpectedValuesForAnalysis ( XmlNode annotationDefn, int hvoInstanceOf ) : void

Set the expected values that we computer or modify rather than reading from the file, for an XmlNode that represents an analysis.

SetExpectedValuesForSegment ( XmlNode annotationDefn, int ichMin ) : void

Set the expected values that we computer or modify rather than reading from the file, for an XmlNode that represents an analysis.

Snapshot ( XmlNode node ) : XmlNode

get a clone of a node (and its owning document)

SnapshotOfPara ( ) : XmlNode
SnapshotOfStText ( ) : XmlNode
StringValue ( int iSegment, int iSegForm ) : string
StringValueNode ( int iSegment, int iSegForm ) : XmlNode
UpdateExpectedWordformsAndOccurrences ( string strForm, int ws ) : void

Method Details

AppendParagraph() public method

public AppendParagraph ( ) : IStTxtPara
return IStTxtPara

CopyContents() static public method

static public CopyContents ( IStTxtPara paraSrc, IStTxtPara paraTarget ) : void
paraSrc IStTxtPara
paraTarget IStTxtPara
return void

CreateParagraph() public method

public CreateParagraph ( int iInsertNewParaAt ) : IStTxtPara
iInsertNewParaAt int
return IStTxtPara

GetStTxtParaDefnNode() static protected method

static protected GetStTxtParaDefnNode ( FDO text, XmlNode textsDefn, int iPara, IStTxtPara &para ) : XmlNode
text FDO
textsDefn XmlNode
iPara int
para IStTxtPara
return XmlNode