<commit_before>#![feature(phase)]

extern crate serialize;
extern crate regex;

use std::sync::{Arc, RWLock};
use std::ascii::AsciiExt;
use std::collections::HashMap;
use std::task::TaskBuilder;

pub use errors::InitializationError;
pub use config::ClientConfiguration;
pub use interface::{CommandEvent, IrcMessageEvent, CtcpEvent, IrcInterface};
use irc::{IrcConnection, IrcMessage};

pub mod errors;
pub mod config;
pub mod interface;
mod irc;

pub fn get_version() -> String {
    return format!("{}.{}.{}", env!("CARGO_PKG_VERSION_MAJOR"), env!("CARGO_PKG_VERSION_MINOR"), env!("CARGO_PKG_VERSION_PATCH"));
}

// TODO: Store channels joined
pub struct Client {
    data_in: Receiver<Option<IrcMessage>>,
    pub interface: IrcInterface,
    commands: Arc<RWLock<HashMap<String, Vec<|&CommandEvent|:Send + Sync>>>>,
    ctcp_listeners: Arc<RWLock<HashMap<String, Vec<|&CtcpEvent|:Send + Sync>>>>,
    raw_listeners: Arc<RWLock<HashMap<String, Vec<|&IrcMessageEvent|:Send + Sync>>>>,
    catch_all: Arc<RWLock<Vec<|&IrcMessageEvent|:Send + Sync>>>,
    config: Arc<ClientConfiguration>,
    irc_connection_channel: Option<(Sender<Option<IrcMessage>>, Receiver<Option<String>>)>,
}

impl Client {
    pub fn new(config: ClientConfiguration) -> Result<Client, InitializationError> {
        let rc_config = Arc::new(config);<commit_msg>Use cargo "pre" version variable as well when formatting the version<commit_after>#![feature(phase)]

extern crate serialize;
extern crate regex;

use std::sync::{Arc, RWLock};
use std::ascii::AsciiExt;
use std::collections::HashMap;
use std::task::TaskBuilder;

pub use errors::InitializationError;
pub use config::ClientConfiguration;
pub use interface::{CommandEvent, IrcMessageEvent, CtcpEvent, IrcInterface};
use irc::{IrcConnection, IrcMessage};

pub mod errors;
pub mod config;
pub mod interface;
mod irc;

pub fn get_version() -> String {
    return format!("{}.{}.{}{}",
        env!("CARGO_PKG_VERSION_MAJOR"),
        env!("CARGO_PKG_VERSION_MINOR"),
        env!("CARGO_PKG_VERSION_PATCH"),
        option_env!("CARGO_PKG_VERSION_PRE").unwrap_or(""));
}

// TODO: Store channels joined
pub struct Client {
    data_in: Receiver<Option<IrcMessage>>,
    pub interface: IrcInterface,
    commands: Arc<RWLock<HashMap<String, Vec<|&CommandEvent|:Send + Sync>>>>,
    ctcp_listeners: Arc<RWLock<HashMap<String, Vec<|&CtcpEvent|:Send + Sync>>>>,
    raw_listeners: Arc<RWLock<HashMap<String, Vec<|&IrcMessageEvent|:Send + Sync>>>>,
    catch_all: Arc<RWLock<Vec<|&IrcMessageEvent|:Send + Sync>>>,
    config: Arc<ClientConfiguration>,
    irc_connection_channel: Option<(Sender<Option<IrcMessage>>, Receiver<Option<String>>)>,
}

impl Client {
    pub fn new(config: ClientConfiguration) -> Result<Client, InitializationError> {
        let rc_config = Arc::new(config);
{'fraction_non_alphanumeric': 0.1510842516885887, 'fraction_numerical': 0.0, 'mean_word_length': 6.3858267716535435, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 55, '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': '1585074', 'n_tokens_mistral': 942, 'n_tokens_neox': 941, 'n_words': 198}