C# Класс SIL.FieldWorks.FDO.DomainServices.SemanticDomainSearch.SemDomSearchStrategy

Показать файл Открыть проект Примеры использования класса

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

CollectPossibleMatchIn() защищенный Метод

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
Результат bool

DoesInputMatchWord() защищенный абстрактный Метод

Each strategy defines how to determine whether a string has a match or not.
protected abstract DoesInputMatchWord ( IEnumerable wordsToLookIn ) : MatchingResult
wordsToLookIn IEnumerable
Результат MatchingResult

GetDomainNameString() защищенный Метод

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
Результат string

GetExampleWordTextFromDomainQuestion() защищенный Метод

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
Результат string

GetExampleWordsString() защищенный Метод

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
Результат string

LookForHitInWordCollection() защищенный Метод

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
Результат MatchingResult

SemDomSearchStrategy() защищенный Метод

Constructor for new search strategy.
protected SemDomSearchStrategy ( FdoCache cache ) : System
cache FdoCache
Результат System

SetupSearchResults() защищенный Метод

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
Результат void