using System;
using System.Collections.Generic;
using System.Text;
namespace ScrewTurn.Wiki.SearchEngine {
///
/// Represents a word structured for easy dumping to disk or database.
///
/// The class is not thread-safe.
public class DumpedWord {
///
/// The word unique ID.
///
protected uint id;
///
/// The word culture-invariant lowercase text.
///
protected string text;
///
/// Initializes a new instance of the class.
///
/// The unique word ID.
/// The word culture-invariant lowercase text.
/// If is null.
/// If is empty.
public DumpedWord(uint id, string text) {
if(text == null) throw new ArgumentNullException("text");
if(text.Length == 0) throw new ArgumentException("Text cannot be empty", "text");
this.id = id;
this.text = text;
}
///
/// Initializes a new instance of the class.
///
/// The word to extract the information from.
/// If is null.
public DumpedWord(Word word) {
if(word == null) throw new ArgumentNullException("word");
this.id = word.ID;
this.text = word.Text;
}
///
/// Gets or sets the word unique ID.
///
public uint ID {
get { return id; }
set { id = value; }
}
///
/// Gets the word culture-invariant lowercase text.
///
public string Text {
get { return text; }
}
}
}