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

Represents a word in a document.
All instance and static members are thread-safe.
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
id uint
occurrences OccurrenceDictionary
text string

공개 메소드들

메소드 설명
AddOccurrence ( IDocument document, ushort firstCharIndex, ushort wordIndex, WordLocation location ) : void

Stores an occurrence.

Adding an occurrence is O(n), where n is the number of occurrences of the word already stored for the same document. If there were no occurrences previously stored, the operation is O(1).

BulkAddOccurrences ( IDocument document, SortedBasicWordInfoSet positions ) : void

Adds a bulk of occurrences of the word in a document, removing all the old positions, if any.

If positions is empty, the effect of the invocation of the method is equal to that of RemoveOccurrences with the same document. Bulk-adding the occurrences is O(1).

RemoveOccurrences ( IDocument document ) : List

Removes all the occurrences for a document.

Removing the occurrences for the document is O(1).

ToString ( ) : string

Gets a string representation of the current instance.

Word ( uint id, string text ) : System

Initializes a new instance of the Word class.

Word ( uint id, string text, OccurrenceDictionary occurrences ) : System

Initializes a new instance of the Word class.

메소드 상세

AddOccurrence() 공개 메소드

Stores an occurrence.
Adding an occurrence is O(n), where n is the number of occurrences of the word already stored for the same document. If there were no occurrences previously stored, the operation is O(1).
If is null. If or are less than zero.
public AddOccurrence ( IDocument document, ushort firstCharIndex, ushort wordIndex, WordLocation location ) : void
document IDocument The document the occurrence is referred to.
firstCharIndex ushort The index of the first character of the word in the document.
wordIndex ushort The index of the word in the document.
location WordLocation The location of the word.
리턴 void

BulkAddOccurrences() 공개 메소드

Adds a bulk of occurrences of the word in a document, removing all the old positions, if any.
If positions is empty, the effect of the invocation of the method is equal to that of RemoveOccurrences with the same document. Bulk-adding the occurrences is O(1).
If or are null.
public BulkAddOccurrences ( IDocument document, SortedBasicWordInfoSet positions ) : void
document IDocument The document.
positions SortedBasicWordInfoSet The positions.
리턴 void

RemoveOccurrences() 공개 메소드

Removes all the occurrences for a document.
Removing the occurrences for the document is O(1).
If is null.
public RemoveOccurrences ( IDocument document ) : List
document IDocument The document to remove the occurrences of.
리턴 List

ToString() 공개 메소드

Gets a string representation of the current instance.
public ToString ( ) : string
리턴 string

Word() 공개 메소드

Initializes a new instance of the Word class.
If is null. If is empty.
public Word ( uint id, string text ) : System
id uint The word ID.
text string The text of the word (lowercase).
리턴 System

Word() 공개 메소드

Initializes a new instance of the Word class.
If or are null. If is empty.
public Word ( uint id, string text, OccurrenceDictionary occurrences ) : System
id uint The word ID.
text string The text of the word (lowercase).
occurrences OccurrenceDictionary The occurrences.
리턴 System

프로퍼티 상세

id 보호되어 있는 프로퍼티

The word unique ID.
protected uint id
리턴 uint

occurrences 보호되어 있는 프로퍼티

The occurrences.
protected OccurrenceDictionary occurrences
리턴 OccurrenceDictionary

text 보호되어 있는 프로퍼티

The word text, lowercase.
protected string text
리턴 string