C# Class SIL.FieldWorks.FDO.DomainServices.SemanticDomainSearch.SemDomSearchStrategy

Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes protégées

Méthode Description
CollectPossibleMatchIn ( string searchIn, ICmSemanticDomain domain, int wholeWordBucket ) : bool

Take a string to look in (from a domain's Name or ExampleWords) and try to find a match for some (strategy-defined) search key(s).

DoesInputMatchWord ( IEnumerable wordsToLookIn ) : MatchingResult

Each strategy defines how to determine whether a string has a match or not.

GetDomainNameString ( ICmSemanticDomain domain ) : string

Get the text from a Semantic Domain's Name field. This version uses BestAnalysisAlternative which should always have a value, but a subclass might use a more specific writing system which may not have a value (i.e. be prepared for a null return value).

GetExampleWordTextFromDomainQuestion ( ICmDomainQ questionObject ) : string

For one Semantic Domain question, return the text of the Example Words field. This baseclass version uses BestAnalysis, which always has a value, but a subclass might use a more specific writing system which could return a null value (i.e. be prepared to handle a null return value).

GetExampleWordsString ( IEnumerable questions ) : string

Takes a list of semantic domain question objects and fishes out the example words and puts them in a space-delimited string for easier searching. This version uses BestAnalysisAlternative.

LookForHitInWordCollection ( IEnumerable wordsToLookIn, string key ) : MatchingResult

Search through a list of words (results of Regex match) for a search key. Return a MatchingResult to inform caller of type of match, if any.

SemDomSearchStrategy ( FdoCache cache ) : System

Constructor for new search strategy.

SetupSearchResults ( ) : void

Subclasses can override to set the search results object to have the correct number of buckets for a different strategy. Baseclass defaults to two buckets.

Private Methods

Méthode Description
GetAppropriateCultureInfo ( ) : CultureInfo
ParseStringIntoWords ( string searchIn ) : IEnumerable
PutDomainInDesiredBucket ( ICmSemanticDomain domain ) : void

Subclasses can override this method to change how Semantic Domains are compared with any search key(s) and the priority types of matches for putting the domain into an appropriate search results bucket (if any). N.B. Strategy subclasses should take care not to add a domain to a bucket if it is already in a higher priority bucket.

Method Details

CollectPossibleMatchIn() protected méthode

Take a string to look in (from a domain's Name or ExampleWords) and try to find a match for some (strategy-defined) search key(s).
protected CollectPossibleMatchIn ( string searchIn, ICmSemanticDomain domain, int wholeWordBucket ) : bool
searchIn string
domain ICmSemanticDomain
wholeWordBucket int
Résultat bool

DoesInputMatchWord() protected abstract méthode

Each strategy defines how to determine whether a string has a match or not.
protected abstract DoesInputMatchWord ( IEnumerable wordsToLookIn ) : MatchingResult
wordsToLookIn IEnumerable
Résultat MatchingResult

GetDomainNameString() protected méthode

Get the text from a Semantic Domain's Name field. This version uses BestAnalysisAlternative which should always have a value, but a subclass might use a more specific writing system which may not have a value (i.e. be prepared for a null return value).
protected GetDomainNameString ( ICmSemanticDomain domain ) : string
domain ICmSemanticDomain
Résultat string

GetExampleWordTextFromDomainQuestion() protected méthode

For one Semantic Domain question, return the text of the Example Words field. This baseclass version uses BestAnalysis, which always has a value, but a subclass might use a more specific writing system which could return a null value (i.e. be prepared to handle a null return value).
protected GetExampleWordTextFromDomainQuestion ( ICmDomainQ questionObject ) : string
questionObject ICmDomainQ
Résultat string

GetExampleWordsString() protected méthode

Takes a list of semantic domain question objects and fishes out the example words and puts them in a space-delimited string for easier searching. This version uses BestAnalysisAlternative.
protected GetExampleWordsString ( IEnumerable questions ) : string
questions IEnumerable
Résultat string

LookForHitInWordCollection() protected méthode

Search through a list of words (results of Regex match) for a search key. Return a MatchingResult to inform caller of type of match, if any.
protected LookForHitInWordCollection ( IEnumerable wordsToLookIn, string key ) : MatchingResult
wordsToLookIn IEnumerable
key string
Résultat MatchingResult

SemDomSearchStrategy() protected méthode

Constructor for new search strategy.
protected SemDomSearchStrategy ( FdoCache cache ) : System
cache FdoCache
Résultat System

SetupSearchResults() protected méthode

Subclasses can override to set the search results object to have the correct number of buckets for a different strategy. Baseclass defaults to two buckets.
protected SetupSearchResults ( ) : void
Résultat void