C# Class SIL.FieldWorks.IText.SandboxBase.GetRealAnalysisMethod

Determine the real analysis corresponding to the current state of the sandbox. The 'real analysis' may be a WfiWordform (if it hasn't been analyzed at all), a WfiAnalysis, or a WfiGloss.
Datei anzeigen Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
m_analysisMorphs int[]
m_analysisMsas int[]
m_analysisSenses int[]
m_caches CachePair
m_choices SIL.FieldWorks.IText.InterlinLineChoices
m_cmorphs int
m_fWantOnlyWfiAnalysis bool
m_helpTopicProvider IHelpTopicProvider
m_hvoSbWord int
m_sandbox SandboxBase
m_sda ISilDataAccess
m_sdaMain ISilDataAccess
m_wa IWfiAnalysis

Public Methods

Method Description
CheckItOut ( ) : void
FindMatchingAnalysis ( bool fExactMatch ) : IWfiAnalysis

Find the analysis that matches the info in the secondary cache.

FindMatchingGloss ( ) : IWfiGloss

Find one of the WfiGlosses of m_hvoWfiAnalysis where the form matches for each analysis writing system. Review: We probably want to find a WfiGloss that matches any (non-zero length) alternative since we don't want to force the user to type in every alternative each time they enter a gloss. Otherwise, if we match one with all non-zero length, return that one. (LT-1428)

GetRealAnalysisMethod ( ) : System

Only used to make the UpdateRealAnalysisMethod construcotr happy. Do not use directly.

GetRealAnalysisMethod ( IHelpTopicProvider helpTopicProvider, SandboxBase owner, CachePair caches, int hvoSbWord, AnalysisTree oldAnalysis, IWfiAnalysis wa, IWfiGloss gloss, SIL.FieldWorks.IText.InterlinLineChoices choices, ITsString tssForm, bool fWantOnlyWfiAnalysis ) : System
Run ( ) : IAnalysis

Run the algorithm, returning the 'analysis' hvo (WfiWordform, WfiAnalysis, or WfiGloss).

Protected Methods

Method Description
BuildMorphLists ( ) : void
EnsureCorrectMorphForms ( ) : void

m_hvoAnalysis is the selected analysis. However, we did not consider writing systems of the morpheme line except the default vernacular one in deciding to use it. If additional WS information has been supplied, save it.

UpdateMlaIfDifferent ( int hvoSrc, int flidSrc, int wsId, int hvoDst, int flidDest ) : void

Ensure that the specified writing system of property flidDest in object hvoDst in m_sdaMain is the same as property flidSrc in object hvoSrc in m_sda. If not, update.

Private Methods

Method Description
AdditionalAlternatives ( IWfiGloss wg, List wsIds ) : int

Count how many non-blank alternatives tss has that are not listed in wsIds.

CheckAnalysis ( int hvoPossibleAnalysis, bool fExactMatch ) : bool

Evaluate the given possible analysis to see whether it matches the current Sandbox data. Review: This is not testing word gloss at all. Is this right?

CopyGlossesToSense ( ILexSense sense ) : void
CopyGlossesToWfiGloss ( IWfiGloss gloss ) : void
FindLexEntryMorphItem ( List morphItems, ILexEntry leTarget ) : IhMorphEntry.MorphItem

Find the morph item referring to the LexEntry (only), not a sense or msa.

FinishItOff ( ) : IAnalysis
GetBestGloss ( IWfiAnalysis wfiAnalysis, List wsIds, ISilDataAccess sda, int hvoWord ) : IWfiGloss

Get the most appropriate WfiGloss from among those belonging to the given WfiAnalysis. The goal is to match as closely as possible the strings found in sda.get_MultiStringAlt(hvoWord, ktagSbWordGloss, ws) for each ws in wsIds. Ideally we find an alternative where all writing systems match exactly. Failing that, one where as many as possible match, and the others are blank.

GetRealHvoFromSbWmbInflType ( int imorph ) : int
IsMlSame ( int hvoSrc, int flidSrc, int wsId, int hvoDst, int flidDest ) : bool
IsMlSame ( int hvoSrc, int flidSrc, int wsId, int hvoDst, int flidDest, ITsString &tss, ITsString &tssOld ) : bool
IsTrivialAnalysis ( IWfiAnalysis possibleAnalysis ) : bool

A trivial analysis, the sort created when just doing word glossing, doesn't really specify anything, though it may have one morph bundle that just matches the whole wordform. It may possibly specify a part of speech, in which case it must match the one the user entered to be reusable.

MatchesCurrentGlosses ( IWfiGloss gloss ) : bool
OnlyUsedThisOnce ( ILexSense sense ) : bool
OnlyUsedThisOnce ( IWfiAnalysis oldAnalysis ) : bool
SbWordGlossMatchesSenseGloss ( IhMorphEntry morphItem ) : bool
SbWordMainPosMatchesSenseMsaMainPos ( IhMorphEntry morphItem ) : bool

see if the MainPossibilities match for the given morphItem and the Word Part of Speech in the sandbox

SbWordPosMatchesSenseMsaPos ( IhMorphEntry morphItem ) : bool
UpdateSense ( ILexSense sense, IPartOfSpeech pos ) : void

Method Details

BuildMorphLists() protected method

protected BuildMorphLists ( ) : void
return void

CheckItOut() public method

public CheckItOut ( ) : void
return void

EnsureCorrectMorphForms() protected method

m_hvoAnalysis is the selected analysis. However, we did not consider writing systems of the morpheme line except the default vernacular one in deciding to use it. If additional WS information has been supplied, save it.
protected EnsureCorrectMorphForms ( ) : void
return void

FindMatchingAnalysis() public method

Find the analysis that matches the info in the secondary cache.
public FindMatchingAnalysis ( bool fExactMatch ) : IWfiAnalysis
fExactMatch bool
return IWfiAnalysis

FindMatchingGloss() public method

Find one of the WfiGlosses of m_hvoWfiAnalysis where the form matches for each analysis writing system. Review: We probably want to find a WfiGloss that matches any (non-zero length) alternative since we don't want to force the user to type in every alternative each time they enter a gloss. Otherwise, if we match one with all non-zero length, return that one. (LT-1428)
public FindMatchingGloss ( ) : IWfiGloss
return IWfiGloss

GetRealAnalysisMethod() public method

Only used to make the UpdateRealAnalysisMethod construcotr happy. Do not use directly.
public GetRealAnalysisMethod ( ) : System
return System

GetRealAnalysisMethod() public method

public GetRealAnalysisMethod ( IHelpTopicProvider helpTopicProvider, SandboxBase owner, CachePair caches, int hvoSbWord, AnalysisTree oldAnalysis, IWfiAnalysis wa, IWfiGloss gloss, SIL.FieldWorks.IText.InterlinLineChoices choices, ITsString tssForm, bool fWantOnlyWfiAnalysis ) : System
helpTopicProvider IHelpTopicProvider
owner SandboxBase
caches CachePair
hvoSbWord int
oldAnalysis AnalysisTree
wa IWfiAnalysis
gloss IWfiGloss
choices SIL.FieldWorks.IText.InterlinLineChoices
tssForm ITsString
fWantOnlyWfiAnalysis bool
return System

Run() public method

Run the algorithm, returning the 'analysis' hvo (WfiWordform, WfiAnalysis, or WfiGloss).
public Run ( ) : IAnalysis
return IAnalysis

UpdateMlaIfDifferent() protected method

Ensure that the specified writing system of property flidDest in object hvoDst in m_sdaMain is the same as property flidSrc in object hvoSrc in m_sda. If not, update.
protected UpdateMlaIfDifferent ( int hvoSrc, int flidSrc, int wsId, int hvoDst, int flidDest ) : void
hvoSrc int
flidSrc int
wsId int
hvoDst int
flidDest int
return void

Property Details

m_analysisMorphs protected_oe property

protected int[] m_analysisMorphs
return int[]

m_analysisMsas protected_oe property

protected int[] m_analysisMsas
return int[]

m_analysisSenses protected_oe property

protected int[] m_analysisSenses
return int[]

m_caches protected_oe property

protected CachePair m_caches
return CachePair

m_choices protected_oe property

protected InterlinLineChoices,SIL.FieldWorks.IText m_choices
return SIL.FieldWorks.IText.InterlinLineChoices

m_cmorphs protected_oe property

protected int m_cmorphs
return int

m_fWantOnlyWfiAnalysis protected_oe property

protected bool m_fWantOnlyWfiAnalysis
return bool

m_helpTopicProvider protected_oe property

protected IHelpTopicProvider m_helpTopicProvider
return IHelpTopicProvider

m_hvoSbWord protected_oe property

protected int m_hvoSbWord
return int

m_sandbox protected_oe property

protected SandboxBase,SIL.FieldWorks.IText m_sandbox
return SandboxBase

m_sda protected_oe property

protected ISilDataAccess m_sda
return ISilDataAccess

m_sdaMain protected_oe property

protected ISilDataAccess m_sdaMain
return ISilDataAccess

m_wa protected_oe property

protected IWfiAnalysis m_wa
return IWfiAnalysis