<commit_before>use std::string::{String};
use super::{utils};
use std::io::net::{ip};
use std::from_str::{FromStr};

/// Maximum length of the local part.
static MAX_MAILBOX_LOCAL_PART_LEN: uint = 64;

/// Maximum length of an email address.
///
/// The RFC doesn't actually specify 254 chars, but it does say that a reverse path starts with
/// "<", ends with ">" and including those symbols has a maximum length of 256.
static MAX_MAILBOX_LEN: uint = 254;

/// Maximum length of a domain name.
static MAX_DOMAIN_LEN: uint = 255;

#[test]
fn test_static_vars() {
    assert_eq!(64, MAX_MAILBOX_LOCAL_PART_LEN);
    assert_eq!(254, MAX_MAILBOX_LEN);
    assert_eq!(255, MAX_DOMAIN_LEN);
}

/// Represents the local part of an email address, aka the username.
#[deriving(PartialEq, Eq, Clone, Show)]
pub struct MailboxLocalPart {
    /// This is a version of the local part for use in the SMTP protocol.
    ///
    /// This is either a dot-string or a quoted-string, whatever is shortest as
    /// recommended in RFC 5321.
    pub smtp_string: String,
    /// This is a version of the local part that is completely unescaped.
    ///
    /// It is human readable but not suitable for use in SMTP.
    pub human_string: String
}

impl MailboxLocalPart {
    /// Create a local part from a dot-string.
    fn from_dot_string(dot_string: &str) -> MailboxLocalPart {
        MailboxLocalPart {<commit_msg>make local part attributes not public, will use immutable getters instead<commit_after>use std::string::{String};
use super::{utils};
use std::io::net::{ip};
use std::from_str::{FromStr};

/// Maximum length of the local part.
static MAX_MAILBOX_LOCAL_PART_LEN: uint = 64;

/// Maximum length of an email address.
///
/// The RFC doesn't actually specify 254 chars, but it does say that a reverse path starts with
/// "<", ends with ">" and including those symbols has a maximum length of 256.
static MAX_MAILBOX_LEN: uint = 254;

/// Maximum length of a domain name.
static MAX_DOMAIN_LEN: uint = 255;

#[test]
fn test_static_vars() {
    assert_eq!(64, MAX_MAILBOX_LOCAL_PART_LEN);
    assert_eq!(254, MAX_MAILBOX_LEN);
    assert_eq!(255, MAX_DOMAIN_LEN);
}

/// Represents the local part of an email address, aka the username.
#[deriving(PartialEq, Eq, Clone, Show)]
pub struct MailboxLocalPart {
    /// This is a version of the local part for use in the SMTP protocol.
    ///
    /// This is either a dot-string or a quoted-string, whatever is shortest as
    /// recommended in RFC 5321.
    smtp_string: String,
    /// This is a version of the local part that is completely unescaped.
    ///
    /// It is human readable but not suitable for use in SMTP.
    human_string: String
}

impl MailboxLocalPart {
    /// Create a local part from a dot-string.
    fn from_dot_string(dot_string: &str) -> MailboxLocalPart {
        MailboxLocalPart {
{'fraction_non_alphanumeric': 0.10749299719887956, 'fraction_numerical': 0.018207282913165267, 'mean_word_length': 3.3618320610687022, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6668002', 'n_tokens_mistral': 918, 'n_tokens_neox': 871, 'n_words': 342}