using System;
namespace BotSharp.Algorithm.Bayesian
{
///
/// Struct TokenInformation
///
public struct TokenInformation
where TToken: IToken
{
///
/// The token
///
public readonly TToken Token;
///
/// The count in the class
///
public long Count;
///
/// The occurrence percentage of the token in the class.
///
public double Percentage;
///
/// Initializes a new instance of the struct.
///
/// The token.
/// The count.
/// The percentage.
/// token
///
/// count;Count must be positive or zero
/// or
/// percentage;Percentage must be positive or zero
///
public TokenInformation(TToken token, long count, double percentage)
{
if (ReferenceEquals(token, null)) throw new ArgumentNullException("token");
if (count < 0) throw new ArgumentOutOfRangeException("count", count, "Count must be positive or zero");
if (percentage < 0) throw new ArgumentOutOfRangeException("percentage", percentage, "Percentage must be positive or zero");
Token = token;
Count = count;
Percentage = percentage;
}
}
}