C# 클래스 ScrewTurn.Wiki.SearchEngine.Tools

Implements useful methods.
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

공개 메소드들

메소드 설명
CleanupKeywords ( string keywords ) : string[]

Cleans up keyworks from invalid characters.

IsDocumentTypeTagIncluded ( string currentTag, string includedTags ) : bool

Determines whether a document tag is contained in a tag array.

The comparison is case-insensitive.

IsSplitChar ( char current ) : bool

Determines whether a char is a split char.

PurgeResultsForAllWords ( SearchResultCollection results, string queryWords ) : float

Purges the invalid results when SearchOptions is AllWords.

PurgeResultsForExactPhrase ( SearchResultCollection results, string queryWords ) : float

Purges the invalid results when SearchOptions is ExactPhrase.

RemoveDiacriticsAndPunctuation ( string input, bool isSingleWord ) : string

Removes "accents" and punctuation from a string, transforming it to lowercase (culture invariant).

RemoveStopWords ( WordInfo words, string stopWords ) : WordInfo[]

Removes stop words from a set of words (case insensitive).

SearchInternal ( string query, string documentTypeTags, bool filterDocumentType, SearchOptions options, IWordFetcher fetcher ) : SearchResultCollection

Performs a search in the index.

SkipSplitChars ( ushort startIndex, string content ) : ushort

Computes the index of the first non-split char given a start index.

Tokenize ( string text ) : WordInfo[]

Tokenizes a string.

Tokenize ( string text, WordLocation location ) : WordInfo[]

Tokenizes a string.

메소드 상세

CleanupKeywords() 공개 정적인 메소드

Cleans up keyworks from invalid characters.
public static CleanupKeywords ( string keywords ) : string[]
keywords string The keywords to cleanup.
리턴 string[]

IsDocumentTypeTagIncluded() 공개 정적인 메소드

Determines whether a document tag is contained in a tag array.
The comparison is case-insensitive.
public static IsDocumentTypeTagIncluded ( string currentTag, string includedTags ) : bool
currentTag string The tag to check for.
includedTags string The tag array.
리턴 bool

IsSplitChar() 공개 정적인 메소드

Determines whether a char is a split char.
public static IsSplitChar ( char current ) : bool
current char The current char.
리턴 bool

PurgeResultsForAllWords() 공개 정적인 메소드

Purges the invalid results when SearchOptions is AllWords.
public static PurgeResultsForAllWords ( SearchResultCollection results, string queryWords ) : float
results SearchResultCollection The results to purge.
queryWords string The query words.
리턴 float

PurgeResultsForExactPhrase() 공개 정적인 메소드

Purges the invalid results when SearchOptions is ExactPhrase.
public static PurgeResultsForExactPhrase ( SearchResultCollection results, string queryWords ) : float
results SearchResultCollection The results to purge.
queryWords string The query words.
리턴 float

RemoveDiacriticsAndPunctuation() 공개 정적인 메소드

Removes "accents" and punctuation from a string, transforming it to lowercase (culture invariant).
public static RemoveDiacriticsAndPunctuation ( string input, bool isSingleWord ) : string
input string The input string.
isSingleWord bool A value indicating whether the input string is a single word.
리턴 string

RemoveStopWords() 공개 정적인 메소드

Removes stop words from a set of words (case insensitive).
If or are null.
public static RemoveStopWords ( WordInfo words, string stopWords ) : WordInfo[]
words WordInfo The input words.
stopWords string The array of stop words.
리턴 WordInfo[]

SearchInternal() 공개 정적인 메소드

Performs a search in the index.
If or are null. If is empty. If is true and is null. If is true and is empty.
public static SearchInternal ( string query, string documentTypeTags, bool filterDocumentType, SearchOptions options, IWordFetcher fetcher ) : SearchResultCollection
query string The search query.
documentTypeTags string The document type tags to include in the search.
filterDocumentType bool true to apply the filter on the document type.
options SearchOptions The search options.
fetcher IWordFetcher An object that is able to fetch words.
리턴 SearchResultCollection

SkipSplitChars() 공개 정적인 메소드

Computes the index of the first non-split char given a start index.
If is null.
public static SkipSplitChars ( ushort startIndex, string content ) : ushort
startIndex ushort The start index.
content string The content.
리턴 ushort

Tokenize() 공개 정적인 메소드

Tokenizes a string.
public static Tokenize ( string text ) : WordInfo[]
text string The text to tokenize.
리턴 WordInfo[]

Tokenize() 공개 정적인 메소드

Tokenizes a string.
If is null.
public static Tokenize ( string text, WordLocation location ) : WordInfo[]
text string The text to tokenize.
location WordLocation The location of the words that are extracted.
리턴 WordInfo[]