C# Class ScrewTurn.Wiki.SearchEngine.Word

Represents a word in a document.
All instance and static members are thread-safe.
Afficher le fichier Open project: mono/ScrewTurnWiki Class Usage Examples

Protected Properties

Свойство Type Description
id uint
occurrences OccurrenceDictionary
text string

Méthodes publiques

Méthode Description
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.

Method Details

AddOccurrence() public méthode

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.
Résultat void

BulkAddOccurrences() public méthode

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.
Résultat void

RemoveOccurrences() public méthode

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.
Résultat List

ToString() public méthode

Gets a string representation of the current instance.
public ToString ( ) : string
Résultat string

Word() public méthode

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).
Résultat System

Word() public méthode

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.
Résultat System

Property Details

id protected_oe property

The word unique ID.
protected uint id
Résultat uint

occurrences protected_oe property

The occurrences.
protected OccurrenceDictionary occurrences
Résultat OccurrenceDictionary

text protected_oe property

The word text, lowercase.
protected string text
Résultat string