<commit_before>// Copyright (c) 2016 <NAME> and the wolfram_alpha_rs contributors
// See the README.md file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Struct and enum definitions of values in the Wolfram|Alpha model.
//!
//! For more information, see [Wolfram|Alpha's API
//! documentation](http://products.wolframalpha.com/api/documentation.html).

#![allow(missing_docs)]
#![cfg_attr(feature = "clippy", allow(cyclomatic_complexity))]

use url::Url;

#[cfg(feature = "nightly")]
include!("model.in.rs");

#[cfg(feature = "with-syntex")]
include!(concat!(env!("OUT_DIR"), "/model.rs"));

#[cfg(test)]
mod tests {
    use serde_xml::from_str;

    use super::{Img, Infos, Pod, QueryResult, Subpod};

    #[test]
    fn test_query_result_deserializer() {
        let s = QUERY_RESULT_STR.to_owned();
        from_str::<QueryResult>(&s).unwrap();

        let s = QUERY_RESULT_2_STR.to_owned();
        from_str::<QueryResult>(&s).unwrap();

        /*
        let s = QUERY_RESULT_3_STR.to_owned();
        let v = from_str::<QueryResult>(&s).unwrap();
<commit_msg>chore: minor code re-organization<commit_after>// Copyright (c) 2016 <NAME> and the wolfram_alpha_rs contributors
// See the README.md file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(missing_docs)]
#![cfg_attr(feature = "clippy", allow(cyclomatic_complexity))]

//! Struct and enum definitions of values in the Wolfram|Alpha model.
//!
//! For more information, see [Wolfram|Alpha's API
//! documentation](http://products.wolframalpha.com/api/documentation.html).

use url::Url;

#[cfg(feature = "nightly")]
include!("model.in.rs");

#[cfg(feature = "with-syntex")]
include!(concat!(env!("OUT_DIR"), "/model.rs"));

#[cfg(test)]
mod tests {
    use serde_xml::from_str;

    use super::{Img, Infos, Pod, QueryResult, Subpod};

    #[test]
    fn test_query_result_deserializer() {
        let s = QUERY_RESULT_STR.to_owned();
        from_str::<QueryResult>(&s).unwrap();

        let s = QUERY_RESULT_2_STR.to_owned();
        from_str::<QueryResult>(&s).unwrap();

        /*
        let s = QUERY_RESULT_3_STR.to_owned();
        let v = from_str::<QueryResult>(&s).unwrap();

{'fraction_non_alphanumeric': 0.16066282420749278, 'fraction_numerical': 0.007204610951008645, 'mean_word_length': 3.8977072310405645, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '7408676', 'n_tokens_mistral': 925, 'n_tokens_neox': 911, 'n_words': 227}